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
FieldsModifier and TypeFieldDescriptionstatic final HttpMethodThe HTTP methodDELETE.static final HttpMethodThe HTTP methodGET.static final HttpMethodThe HTTP methodHEAD.static final HttpMethodThe HTTP methodOPTIONS.static final HttpMethodThe HTTP methodPATCH.static final HttpMethodThe HTTP methodPOST.static final HttpMethodThe HTTP methodPUT.static final HttpMethodThe HTTP methodTRACE. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(HttpMethod other) booleaninthashCode()booleanDetermine whether thisHttpMethodmatches the given method value.name()Return the name of this method, e.g.toString()static HttpMethodReturn anHttpMethodobject 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 anHttpMethodobject for the given value.- Parameters:
method- the method value as a String- Returns:
- the corresponding
HttpMethod
-
name
Return the name of this method, e.g. "GET", "POST". -
matches
Determine whether thisHttpMethodmatches the given method value.- Parameters:
method- the HTTP method as a String- Returns:
trueif it matches,falseotherwise- Since:
- 4.2.4
-
compareTo
- Specified by:
compareToin interfaceComparable<HttpMethod>
-
hashCode
public int hashCode() -
equals
-
toString
-