Package ratpack.http
Interface HttpMethod
-
public interface HttpMethodThe method of a HTTP request.
-
-
Field Summary
Fields Modifier and Type Field Description static HttpMethodDELETEThe DELETE method.static HttpMethodGETThe GET method.static HttpMethodHEADThe HEAD method.static HttpMethodOPTIONSThe OPTIONS method.static HttpMethodPATCHThe PATCH method.static HttpMethodPOSTThe POST method.static HttpMethodPUTThe PUT method.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetName()The name of the method, always in upper case.io.netty.handler.codec.http.HttpMethodgetNettyMethod()Returns the method in the underlying Netty form.booleanisDelete()True if the method is DELETE.booleanisGet()True if the method is GET or HEAD.booleanisHead()True if the method is HEAD.booleanisOptions()True if the method is OPTIONS.booleanisPatch()True if the method is PATCH.booleanisPost()True if the method is POST.booleanisPut()True if the method is PUT.booleanname(java.lang.String name)Returns true if the method has the given name, insensitive to case.static HttpMethodof(java.lang.String name)Creates a method of the given name.
-
-
-
Field Detail
-
GET
static final HttpMethod GET
The GET method.- Since:
- 1.4
-
HEAD
static final HttpMethod HEAD
The HEAD method.- Since:
- 1.4
-
POST
static final HttpMethod POST
The POST method.- Since:
- 1.4
-
PUT
static final HttpMethod PUT
The PUT method.- Since:
- 1.4
-
DELETE
static final HttpMethod DELETE
The DELETE method.- Since:
- 1.4
-
PATCH
static final HttpMethod PATCH
The PATCH method.- Since:
- 1.4
-
OPTIONS
static final HttpMethod OPTIONS
The OPTIONS method.- Since:
- 1.4
-
-
Method Detail
-
of
static HttpMethod of(java.lang.String name)
Creates a method of the given name.- Parameters:
name- the method name- Since:
- 1.4
-
getName
java.lang.String getName()
The name of the method, always in upper case.- Returns:
- The name of the method, always in upper case.
-
isPost
boolean isPost()
True if the method is POST.- Returns:
- True if the method is POST.
-
isGet
boolean isGet()
True if the method is GET or HEAD.- Returns:
- True if the method is GET or HEAD.
-
isPut
boolean isPut()
True if the method is PUT.- Returns:
- True if the method is PUT.
-
isPatch
boolean isPatch()
True if the method is PATCH.- Returns:
- True if the method is PATCH.
-
isDelete
boolean isDelete()
True if the method is DELETE.- Returns:
- True if the method is DELETE.
-
isOptions
boolean isOptions()
True if the method is OPTIONS.- Returns:
- True if the method is OPTIONS.
-
isHead
boolean isHead()
True if the method is HEAD.- Returns:
- True if the method is HEAD.
-
name
boolean name(java.lang.String name)
Returns true if the method has the given name, insensitive to case.- Parameters:
name- The name of the method to compare to the actual method name.- Returns:
- True if the given name equals
getName()irrespective of case.
-
getNettyMethod
io.netty.handler.codec.http.HttpMethod getNettyMethod()
Returns the method in the underlying Netty form.Use of this method should be avoided, in favor of using the other methods of this interface.
- Returns:
- the method in the underlying Netty form
- Since:
- 1.4
-
-