public abstract class AbstractMethod extends java.lang.Object implements HttpMethod
HttpMethod. By default this method is not safe and not idempotent.| Constructor and Description |
|---|
AbstractMethod(java.lang.String verb,
boolean supportsRequestPayload)
Instantiates a new
HttpMethod with the given verb. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
supportsRequestPayload()
Returns whether this
HttpMethod allows to send a message body. |
java.lang.String |
verb()
Returns the HTTP verb of this method.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisIdempotent, isSafepublic AbstractMethod(java.lang.String verb,
boolean supportsRequestPayload)
HttpMethod with the given verb.verb - The method verb.supportsRequestPayload - whether this method support sending a request message body.public final java.lang.String verb()
HttpMethodverb in interface HttpMethodpublic final boolean supportsRequestPayload()
HttpMethodHttpMethod allows to send a message body.
Note that RFC 7231 does not explicitly forbid a message payload for some methods (in particular these are HttpMethod.GET, HttpMethod.HEAD, HttpMethod.DELETE
and HttpMethod.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.supportsRequestPayload in interface HttpMethodtrue if this method supports a message body, false otherwise.public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Object