Class HttpMethod
java.lang.Object
org.springframework.http.HttpMethod
- All Implemented Interfaces:
Serializable
,Comparable<HttpMethod>
Represents an HTTP request method. Intended for use
with
ClientHttpRequest
and RestTemplate
.- Since:
- 3.0
- Author:
- Arjen Poutsma, Juergen Hoeller
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpMethod
The HTTP methodDELETE
.static final HttpMethod
The HTTP methodGET
.static final HttpMethod
The HTTP methodHEAD
.static final HttpMethod
The HTTP methodOPTIONS
.static final HttpMethod
The HTTP methodPATCH
.static final HttpMethod
The HTTP methodPOST
.static final HttpMethod
The HTTP methodPUT
.static final HttpMethod
The HTTP methodTRACE
. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(HttpMethod other) boolean
int
hashCode()
boolean
Determine whether thisHttpMethod
matches the given method value.name()
Return the name of this method, for example, "GET", "POST".toString()
static HttpMethod
Return anHttpMethod
object for the given value.static HttpMethod[]
values()
Returns an array containing the standard HTTP methods.
-
Field Details
-
GET
-
HEAD
-
POST
-
PUT
-
PATCH
-
DELETE
-
OPTIONS
-
TRACE
-
-
Method Details
-
values
-
valueOf
Return anHttpMethod
object for the given value.- Parameters:
method
- the method value as a String- Returns:
- the corresponding
HttpMethod
-
name
Return the name of this method, for example, "GET", "POST". -
matches
Determine whether thisHttpMethod
matches the given method value.- Parameters:
method
- the HTTP method as a String- Returns:
true
if it matches,false
otherwise- Since:
- 4.2.4
-
compareTo
- Specified by:
compareTo
in interfaceComparable<HttpMethod>
-
hashCode
-
equals
-
toString
-