Package ratpack.core.http
Interface HttpMethod
-
public interface HttpMethod
The method of a HTTP request.
-
-
Field Summary
Fields Modifier and Type Field Description static HttpMethod
DELETE
The DELETE method.static HttpMethod
GET
The GET method.static HttpMethod
HEAD
The HEAD method.static HttpMethod
OPTIONS
The OPTIONS method.static HttpMethod
PATCH
The PATCH method.static HttpMethod
POST
The POST method.static HttpMethod
PUT
The PUT method.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getName()
The name of the method, always in upper case.io.netty.handler.codec.http.HttpMethod
getNettyMethod()
Returns the method in the underlying Netty form.boolean
isDelete()
True if the method is DELETE.boolean
isGet()
True if the method is GET or HEAD.boolean
isHead()
True if the method is HEAD.boolean
isOptions()
True if the method is OPTIONS.boolean
isPatch()
True if the method is PATCH.boolean
isPost()
True if the method is POST.boolean
isPut()
True if the method is PUT.boolean
name(String name)
Returns true if the method has the given name, insensitive to case.static HttpMethod
of(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(String name)
Creates a method of the given name.- Parameters:
name
- the method name- Since:
- 1.4
-
getName
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(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
-
-