Package io.micronaut.http
Enum Class HttpMethod
- All Implemented Interfaces:
- Serializable,- CharSequence,- Comparable<HttpMethod>,- Constable
An enum containing the valid HTTP methods. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html.
- Since:
- 1.0
- Author:
- Graeme Rocher
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.9.A custom non-standard HTTP method.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2.See https://tools.ietf.org/html/rfc5789.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6.See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.8.
- 
Method SummaryModifier and TypeMethodDescriptioncharcharAt(int index) intlength()static HttpMethodbooleanWhether the given method allows a request body.static booleanpermitsRequestBody(HttpMethod method) Whether the given method allows a request body.booleanWhether the given method allows a request body.booleanWhether the given method requires a request body.static booleanrequiresRequestBody(HttpMethod method) Whether the given method requires a request body.subSequence(int start, int end) static HttpMethodReturns the enum constant of this class with the specified name.static HttpMethod[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enumclone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.lang.CharSequencechars, codePoints, isEmpty, toString
- 
Enum Constant Details- 
OPTIONSSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2.
- 
GETSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3.
- 
HEADSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4.
- 
POSTSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5.
- 
PUTSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6.
- 
DELETESee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7.
- 
TRACESee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.8.
- 
CONNECTSee https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.9.
- 
PATCHSee https://tools.ietf.org/html/rfc5789.
- 
CUSTOMA custom non-standard HTTP method.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
lengthpublic int length()- Specified by:
- lengthin interface- CharSequence
 
- 
charAtpublic char charAt(int index) - Specified by:
- charAtin interface- CharSequence
 
- 
subSequence- Specified by:
- subSequencein interface- CharSequence
 
- 
requiresRequestBodypublic boolean requiresRequestBody()Whether the given method requires a request body.- Returns:
- Does the method require a request body.
- Since:
- 4.0.0
 
- 
permitsRequestBodypublic boolean permitsRequestBody()Whether the given method allows a request body.- Returns:
- Does the method allows a request body.
- Since:
- 4.0.0
 
- 
permitsResponseBodypublic boolean permitsResponseBody()Whether the given method allows a request body.- Returns:
- Does the method allows a request body.
- Since:
- 4.0.0
 
- 
requiresRequestBodyWhether the given method requires a request body.- Parameters:
- method- The- HttpMethod
- Returns:
- True if it does
 
- 
permitsRequestBodyWhether the given method allows a request body.- Parameters:
- method- The- HttpMethod
- Returns:
- True if it does
 
- 
parse- Parameters:
- httpMethodName- Name of the http method (maybe nonstandard)
- Returns:
- the value of enum (CUSTOM by default).
 
 
-