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 Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum 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 Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) int
length()
static HttpMethod
boolean
Whether the given method allows a request body.static boolean
permitsRequestBody
(HttpMethod method) Whether the given method allows a request body.boolean
Whether the given method allows a request body.boolean
Whether the given method requires a request body.static boolean
requiresRequestBody
(HttpMethod method) Whether the given method requires a request body.subSequence
(int start, int end) static HttpMethod
Returns 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.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toString
-
Enum Constant Details
-
OPTIONS
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2. -
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. -
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. -
DELETE
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7. -
TRACE
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.8. -
CONNECT
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.9. -
PATCH
See https://tools.ietf.org/html/rfc5789. -
CUSTOM
A custom non-standard HTTP method.
-
-
Method Details
-
values
Returns 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
-
valueOf
Returns 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 nameNullPointerException
- if the argument is null
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
requiresRequestBody
public boolean requiresRequestBody()Whether the given method requires a request body.- Returns:
- Does the method require a request body.
- Since:
- 4.0.0
-
permitsRequestBody
public boolean permitsRequestBody()Whether the given method allows a request body.- Returns:
- Does the method allows a request body.
- Since:
- 4.0.0
-
permitsResponseBody
public boolean permitsResponseBody()Whether the given method allows a request body.- Returns:
- Does the method allows a request body.
- Since:
- 4.0.0
-
requiresRequestBody
Whether the given method requires a request body.- Parameters:
method
- TheHttpMethod
- Returns:
- True if it does
-
permitsRequestBody
Whether the given method allows a request body.- Parameters:
method
- TheHttpMethod
- Returns:
- True if it does
-
parse
- Parameters:
httpMethodName
- Name of the http method (maybe nonstandard)- Returns:
- the value of enum (CUSTOM by default).
-