public interface HttpMethod
| Modifier and Type | Field and Description |
|---|---|
static HttpMethod |
CONNECT
HTTP Method CONNECT
|
static HttpMethod |
DELETE
HTTP Method DELETE
|
static HttpMethod |
GET
HTTP Method GET
|
static HttpMethod |
HEAD
HTTP Method HEAD
|
static HttpMethod |
OPTIONS
HTTP Method OPTIONS
|
static HttpMethod |
PATCH
HTTP Method PATCH
|
static HttpMethod |
POST
HTTP Method POST
|
static HttpMethod |
PUT
HTTP Method PUT
|
static HttpMethod |
TRACE
HTTP Method TRACE
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isIdempotent()
Returns if this request method is idempotent, which means that sending multiple identical requests with that method has the same effect as sending one
single request to the server.
|
boolean |
isSafe()
Returns if this request method is safe, which means that the request is not intended and not expected to change any state on the server.
|
boolean |
supportsRequestPayload()
Returns whether this
HttpMethod allows to send a message body. |
java.lang.String |
verb()
Returns the HTTP verb of this method.
|
static final HttpMethod GET
static final HttpMethod HEAD
static final HttpMethod POST
static final HttpMethod PUT
static final HttpMethod DELETE
static final HttpMethod CONNECT
static final HttpMethod OPTIONS
static final HttpMethod TRACE
static final HttpMethod PATCH
java.lang.String verb()
boolean isSafe()
boolean isIdempotent()
boolean supportsRequestPayload()
HttpMethod allows to send a message body.
Note that RFC 7231 does not explicitly forbid a message payload for some methods (in particular these are GET, HEAD, DELETE
and CONNECT). Instead is says something like this:
A payload within a XXX request message has no defined semantics; sending a payload body on a XXX request might cause some existing implementations to reject the request.The predefined methods in
HttpMethod interpret this rather strict and return false for such methods.true if this method supports a message body, false otherwise.