Package org.eclipse.jetty.http
Enum HttpMethod
- java.lang.Object
-
- java.lang.Enum<HttpMethod>
-
- org.eclipse.jetty.http.HttpMethod
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<HttpMethod>
public enum HttpMethod extends java.lang.Enum<HttpMethod>
Known HTTP Methods
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACL
BASELINE_CONTROL
BIND
CHECKIN
CHECKOUT
CONNECT
COPY
DELETE
GET
HEAD
LABEL
LINK
LOCK
MERGE
MKACTIVITY
MKCALENDAR
MKCOL
MKREDIRECTREF
MKWORKSPACE
MOVE
OPTIONS
ORDERPATCH
PATCH
POST
PRI
PROPFIND
PROPPATCH
PROXY
PUT
REBIND
REPORT
SEARCH
TRACE
UNBIND
UNCHECKOUT
UNLINK
UNLOCK
UPDATE
UPDATEREDIRECTREF
VERSION_CONTROL
-
Field Summary
Fields Modifier and Type Field Description static int
ACL_AS_INT
static Trie<HttpMethod>
CACHE
static int
GET_AS_INT
static int
HEAD_AS_INT
static Trie<HttpMethod>
INSENSITIVE_CACHE
static Trie<HttpMethod>
LOOK_AHEAD
static int
POST_AS_INT
static int
PRI_AS_INT
static int
PUT_AS_INT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBuffer
asBuffer()
java.lang.String
asString()
static HttpMethod
fromString(java.lang.String method)
Converts the given String parameter to an HttpMethod.byte[]
getBytes()
boolean
is(java.lang.String s)
boolean
isIdempotent()
An idempotent HTTP method is an HTTP method that can be called many times without different outcomes.boolean
isSafe()
An HTTP method is safe if it doesn't alter the state of the server.static HttpMethod
lookAheadGet(byte[] bytes, int position, int limit)
Deprecated.Not usedstatic HttpMethod
lookAheadGet(java.nio.ByteBuffer buffer)
Optimized lookup to find a method name and trailing space in a byte array.java.lang.String
toString()
static HttpMethod
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static HttpMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACL
public static final HttpMethod ACL
-
BASELINE_CONTROL
public static final HttpMethod BASELINE_CONTROL
-
BIND
public static final HttpMethod BIND
-
CHECKIN
public static final HttpMethod CHECKIN
-
CHECKOUT
public static final HttpMethod CHECKOUT
-
CONNECT
public static final HttpMethod CONNECT
-
COPY
public static final HttpMethod COPY
-
DELETE
public static final HttpMethod DELETE
-
GET
public static final HttpMethod GET
-
HEAD
public static final HttpMethod HEAD
-
LABEL
public static final HttpMethod LABEL
-
LINK
public static final HttpMethod LINK
-
LOCK
public static final HttpMethod LOCK
-
MERGE
public static final HttpMethod MERGE
-
MKACTIVITY
public static final HttpMethod MKACTIVITY
-
MKCALENDAR
public static final HttpMethod MKCALENDAR
-
MKCOL
public static final HttpMethod MKCOL
-
MKREDIRECTREF
public static final HttpMethod MKREDIRECTREF
-
MKWORKSPACE
public static final HttpMethod MKWORKSPACE
-
MOVE
public static final HttpMethod MOVE
-
OPTIONS
public static final HttpMethod OPTIONS
-
ORDERPATCH
public static final HttpMethod ORDERPATCH
-
PATCH
public static final HttpMethod PATCH
-
POST
public static final HttpMethod POST
-
PRI
public static final HttpMethod PRI
-
PROPFIND
public static final HttpMethod PROPFIND
-
PROPPATCH
public static final HttpMethod PROPPATCH
-
PUT
public static final HttpMethod PUT
-
REBIND
public static final HttpMethod REBIND
-
REPORT
public static final HttpMethod REPORT
-
SEARCH
public static final HttpMethod SEARCH
-
TRACE
public static final HttpMethod TRACE
-
UNBIND
public static final HttpMethod UNBIND
-
UNCHECKOUT
public static final HttpMethod UNCHECKOUT
-
UNLINK
public static final HttpMethod UNLINK
-
UNLOCK
public static final HttpMethod UNLOCK
-
UPDATE
public static final HttpMethod UPDATE
-
UPDATEREDIRECTREF
public static final HttpMethod UPDATEREDIRECTREF
-
VERSION_CONTROL
public static final HttpMethod VERSION_CONTROL
-
PROXY
public static final HttpMethod PROXY
-
-
Field Detail
-
INSENSITIVE_CACHE
public static final Trie<HttpMethod> INSENSITIVE_CACHE
-
CACHE
public static final Trie<HttpMethod> CACHE
-
LOOK_AHEAD
public static final Trie<HttpMethod> LOOK_AHEAD
-
ACL_AS_INT
public static final int ACL_AS_INT
- See Also:
- Constant Field Values
-
GET_AS_INT
public static final int GET_AS_INT
- See Also:
- Constant Field Values
-
PRI_AS_INT
public static final int PRI_AS_INT
- See Also:
- Constant Field Values
-
PUT_AS_INT
public static final int PUT_AS_INT
- See Also:
- Constant Field Values
-
POST_AS_INT
public static final int POST_AS_INT
- See Also:
- Constant Field Values
-
HEAD_AS_INT
public static final int HEAD_AS_INT
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static HttpMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpMethod c : HttpMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpMethod valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getBytes
public byte[] getBytes()
-
is
public boolean is(java.lang.String s)
-
isSafe
public boolean isSafe()
An HTTP method is safe if it doesn't alter the state of the server. In other words, a method is safe if it leads to a read-only operation. Several common HTTP methods are safe: GET , HEAD , or OPTIONS . All safe methods are also idempotent, but not all idempotent methods are safe- Returns:
- if the method is safe.
-
isIdempotent
public boolean isIdempotent()
An idempotent HTTP method is an HTTP method that can be called many times without different outcomes. It would not matter if the method is called only once, or ten times over. The result should be the same.- Returns:
- true if the method is idempotent.
-
asBuffer
public java.nio.ByteBuffer asBuffer()
-
asString
public java.lang.String asString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<HttpMethod>
-
lookAheadGet
@Deprecated public static HttpMethod lookAheadGet(byte[] bytes, int position, int limit)
Deprecated.Not usedOptimized lookup to find a method name and trailing space in a byte array.- Parameters:
bytes
- Array containing ISO-8859-1 charactersposition
- The first valid indexlimit
- The first non valid index- Returns:
- An HttpMethod if a match or null if no easy match.
-
lookAheadGet
public static HttpMethod lookAheadGet(java.nio.ByteBuffer buffer)
Optimized lookup to find a method name and trailing space in a byte array.- Parameters:
buffer
- buffer containing ISO-8859-1 characters, it is not modified.- Returns:
- An HttpMethod if a match or null if no easy match.
-
fromString
public static HttpMethod fromString(java.lang.String method)
Converts the given String parameter to an HttpMethod. The string may differ from the Enum name as a '-' in the method name is represented as a '_' in the Enum name.- Parameters:
method
- the String to get the equivalent HttpMethod from- Returns:
- the HttpMethod or null if the parameter method is unknown
-
-