public enum HttpMethod extends java.lang.Enum<HttpMethod> implements HttpVerb
Enum Constant and Description |
---|
CONNECT |
DELETE |
GET |
HEAD |
OPTIONS |
PATCH |
POST |
PUT |
TRACE |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString()
Returns the string representation of the method (e.g.
|
static HttpMethod |
getHttp11Method(java.lang.String methodName)
Returns the corresponding HTTP/1.1 method that corresponds to the given name
(case-insensitive) or null if the name does not match any HTTP/1.1 method.
|
java.lang.String |
getName()
The (upper-case) name of the HTTP method (e.g.
|
boolean |
hasBody()
Returns true if this method typically is used with a request body.
|
boolean |
isMethod(java.lang.String method)
Returns true if the given string equals (case-insensitive) this
HttpMethod's name.
|
java.lang.String |
toString() |
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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
getDeclaringClass, name, ordinal
public static final HttpMethod GET
public static final HttpMethod POST
public static final HttpMethod PUT
public static final HttpMethod DELETE
public static final HttpMethod HEAD
public static final HttpMethod OPTIONS
public static final HttpMethod CONNECT
public static final HttpMethod TRACE
public static final HttpMethod PATCH
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 static HttpMethod getHttp11Method(java.lang.String methodName)
public java.lang.String getName()
public boolean hasBody()
public boolean isMethod(java.lang.String method)
public java.lang.String asString()
asString
in interface IStringRepresentation
public java.lang.String toString()
toString
in class java.lang.Enum<HttpMethod>