Package com.linecorp.armeria.common
Enum Class HttpMethod
- All Implemented Interfaces:
Serializable
,Comparable<HttpMethod>
,Constable
HTTP request method.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe CONNECT method which is used for a proxy that can dynamically switch to being a tunnel or for bootstrapping WebSockets with HTTP/2.The DELETE method which requests that the origin server delete the resource identified by the Request-URI.The GET method which means retrieve whatever information (in the form of an entity) is identified by the Request-URI.The HEAD method which is identical to GET except that the server MUST NOT return a message-body in the response.The OPTIONS method which represents a request for information about the communication options available on the request/response chain identified by the Request-URI.The PATCH method which requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI.The POST method which is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.The PUT method which requests that the enclosed entity be stored under the supplied Request-URI.The TRACE method which is used to invoke a remote, application-layer loop-back of the request message.A special constant returned byRequestHeaderGetters.method()
to signify that a request has a method not defined in this enum. -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<HttpMethod>
static boolean
isSupported
(String value) Returns whether the specifiedString
is one of the supported method names.static Set<HttpMethod>
Returns allHttpMethod
s exceptUNKNOWN
.static @Nullable HttpMethod
Parses the specifiedString
into anHttpMethod
.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.
-
Enum Constant Details
-
OPTIONS
The OPTIONS method which represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. -
GET
The GET method which means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process. -
HEAD
The HEAD method which is identical to GET except that the server MUST NOT return a message-body in the response. -
POST
The POST method which is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. -
PUT
The PUT method which requests that the enclosed entity be stored under the supplied Request-URI. -
PATCH
The PATCH method which requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. -
DELETE
The DELETE method which requests that the origin server delete the resource identified by the Request-URI. -
TRACE
The TRACE method which is used to invoke a remote, application-layer loop-back of the request message. -
CONNECT
The CONNECT method which is used for a proxy that can dynamically switch to being a tunnel or for bootstrapping WebSockets with HTTP/2. Note that Armeria handles aCONNECT
request only for bootstrapping WebSockets. -
UNKNOWN
A special constant returned byRequestHeaderGetters.method()
to signify that a request has a method not defined in this enum.
-
-
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
-
isSupported
Returns whether the specifiedString
is one of the supported method names.- Returns:
true
if supported.false
otherwise.
-
idempotentMethods
-
knownMethods
Returns allHttpMethod
s exceptUNKNOWN
. -
tryParse
Parses the specifiedString
into anHttpMethod
. This method will return the sameHttpMethod
instance for equal values ofmethod
. Note that this method will not treat"UNKNOWN"
as a valid value and thus will returnnull
when"UNKNOWN"
is given.- Returns:
null
if there is no suchHttpMethod
available
-