Package nl.colorize.util.http
Enum Class Method
- All Implemented Interfaces:
Serializable
,Comparable<Method>
,Constable
HTTP request methods, as defined by the HTTP/1.1 standard. Refer to
RFC 7231 for more
information.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If true, HTTP requests using this method will send request parameters as part of the request body.boolean
If true, HTTP requests using this method should only download the response headers, not the response body.boolean
isSafe()
Indicates that this request method is "safe" and intended for information retrieval without changing the state of the server.static Method
Returns theMethod
instance corresponding to the HTTP request method with the specified name.static Method
Returns the enum constant of this class with the specified name.static Method[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GET
-
HEAD
-
POST
-
PUT
-
DELETE
-
CONNECT
-
OPTIONS
-
TRACE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
hasRequestBody
public boolean hasRequestBody()If true, HTTP requests using this method will send request parameters as part of the request body. Note that the specification does not forbid a request body to be present, but some web servers will ignore the request body if it's not "supposed" to be there. -
isResponseHeadersOnly
public boolean isResponseHeadersOnly()If true, HTTP requests using this method should only download the response headers, not the response body. -
isSafe
public boolean isSafe()Indicates that this request method is "safe" and intended for information retrieval without changing the state of the server. -
parse
Returns theMethod
instance corresponding to the HTTP request method with the specified name.- Throws:
IllegalArgumentException
- if there is no matching request method.NullPointerException
- ifmethodName
isnull
.
-