Package org.springframework.http
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
Modifier 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
The HTTP methodGET
.- See Also:
-
HEAD
The HTTP methodHEAD
.- See Also:
-
POST
The HTTP methodPOST
.- See Also:
-
PUT
The HTTP methodPUT
.- See Also:
-
PATCH
The HTTP methodPATCH
.- See Also:
-
DELETE
The HTTP methodDELETE
.- See Also:
-
OPTIONS
The HTTP methodOPTIONS
.- See Also:
-
TRACE
The HTTP methodTRACE
.- See Also:
-
-
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
public int hashCode() -
equals
-
toString
-