public enum HttpMethod extends java.lang.Enum<HttpMethod> implements java.lang.CharSequence
Enum Constant and Description |
---|
CONNECT
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.9.
|
CUSTOM
A custom non-standard HTTP method.
|
DELETE
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7.
|
GET
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3.
|
HEAD
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4.
|
OPTIONS
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2.
|
PATCH
See https://tools.ietf.org/html/rfc5789.
|
POST
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5.
|
PUT
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6.
|
TRACE
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.8.
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
int |
length() |
static HttpMethod |
parse(java.lang.String httpMethodName) |
static boolean |
permitsRequestBody(HttpMethod method)
Whether the given method allows a request body.
|
static boolean |
requiresRequestBody(HttpMethod method)
Whether the given method requires a request body.
|
java.lang.CharSequence |
subSequence(int start,
int end) |
static HttpMethod |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HttpMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HttpMethod OPTIONS
public static final HttpMethod GET
public static final HttpMethod HEAD
public static final HttpMethod POST
public static final HttpMethod PUT
public static final HttpMethod DELETE
public static final HttpMethod TRACE
public static final HttpMethod CONNECT
public static final HttpMethod PATCH
public static final HttpMethod CUSTOM
public static HttpMethod[] values()
for (HttpMethod c : HttpMethod.values()) System.out.println(c);
public static HttpMethod valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public static boolean requiresRequestBody(HttpMethod method)
method
- The HttpMethod
public static boolean permitsRequestBody(HttpMethod method)
method
- The HttpMethod
public static HttpMethod parse(java.lang.String httpMethodName)
httpMethodName
- Name of the http method (may be nonstandard)