Package com.linecorp.armeria.common
Class HttpStatus
java.lang.Object
com.linecorp.armeria.common.HttpStatus
- All Implemented Interfaces:
Comparable<HttpStatus>
HTTP response code and its description.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HttpStatus
202 Accepted.static final HttpStatus
502 Bad Gateway.static final HttpStatus
400 Bad Request.static final HttpStatus
499 Client Closed Request.static final HttpStatus
409 Conflict.static final HttpStatus
100 Continue.static final HttpStatus
201 Created.static final HttpStatus
417 Expectation Failed.static final HttpStatus
424 Failed Dependency (WebDAV, RFC4918).static final HttpStatus
403 Forbidden.static final HttpStatus
302 Found.static final HttpStatus
504 Gateway Timeout.static final HttpStatus
410 Gone.static final HttpStatus
505 HTTP Version Not Supported.static final HttpStatus
507 Insufficient Storage (WebDAV, RFC4918).static final HttpStatus
500 Internal Server Error.static final HttpStatus
411 Length Required.static final HttpStatus
423 Locked (WebDAV, RFC4918).static final HttpStatus
405 Method Not Allowed.static final HttpStatus
421 Misdirected Request.static final HttpStatus
301 Moved Permanently.static final HttpStatus
207 Multi-Status (WebDAV, RFC2518).static final HttpStatus
300 Multiple Choices.static final HttpStatus
511 Network Authentication Required (RFC6585).static final HttpStatus
204 No Content.static final HttpStatus
203 Non-Authoritative Information (since HTTP/1.1).static final HttpStatus
406 Not Acceptable.static final HttpStatus
510 Not Extended (RFC2774).static final HttpStatus
404 Not Found.static final HttpStatus
501 Not Implemented.static final HttpStatus
304 Not Modified.static final HttpStatus
200 OK.static final HttpStatus
206 Partial Content.static final HttpStatus
402 Payment Required.static final HttpStatus
412 Precondition Failed.static final HttpStatus
428 Precondition Required (RFC6585).static final HttpStatus
102 Processing (WebDAV, RFC2518).static final HttpStatus
407 Proxy Authentication Required.static final HttpStatus
413 Request Entity Too Large.static final HttpStatus
431 Request Header Fields Too Large (RFC6585).static final HttpStatus
408 Request Timeout.static final HttpStatus
414 Request-URI Too Long.static final HttpStatus
416 Requested Range Not Satisfiable.static final HttpStatus
205 Reset Content.static final HttpStatus
303 See Other (since HTTP/1.1).static final HttpStatus
503 Service Unavailable.static final HttpStatus
101 Switching Protocols.static final HttpStatus
307 Temporary Redirect (since HTTP/1.1).static final HttpStatus
429 Too Many Requests (RFC6585).static final HttpStatus
401 Unauthorized.static final HttpStatus
A special status code '0' which represents that the response status is unknown.static final HttpStatus
425 Unordered Collection (WebDAV, RFC3648).static final HttpStatus
422 Unprocessable Entity (WebDAV, RFC4918).static final HttpStatus
415 Unsupported Media Type.static final HttpStatus
426 Upgrade Required (RFC2817).static final HttpStatus
305 Use Proxy (since HTTP/1.1).static final HttpStatus
506 Variant Also Negotiates (RFC2295). -
Constructor Summary
ConstructorDescriptionHttpStatus
(int statusCode, @Nullable String reasonPhrase) Creates a new instance with the specified status code and its reason phrase. -
Method Summary
Modifier and TypeMethodDescriptionint
code()
Returns the code of thisHttpStatus
.Returns the status code asString
.Returns the class of thisHttpStatus
.int
Compares this status to the specified status.boolean
Returns whether the specified object is "equal to" this status.int
hashCode()
boolean
Returns whether theHttpStatus
is a client error, with a status code of 4XX.boolean
Returnstrue
if the content of the response for thisHttpStatus
is expected to be always empty (204, 205 and 304 responses.)static boolean
isContentAlwaysEmpty
(int statusCode) Returnstrue
if the content of the response for the specified status code is expected to be always empty (204, 205 and 304 responses.)boolean
isError()
Returns whether theHttpStatus
is an error.boolean
Returns whether theHttpStatus
is an information, with a status code of 1XX.boolean
Returns whether theHttpStatus
is a redirection, with a status code of 3XX.boolean
Returns whether theHttpStatus
is a server error, with a status code of 5XX.boolean
Returns whether theHttpStatus
is a success, with a status code of 2XX.Returns the reason phrase of thisHttpStatus
.Returns theHttpData
whose content is"<code> <reasonPhrase>"
encoded in UTF-8.toString()
static HttpStatus
valueOf
(int statusCode) Returns theHttpStatus
represented by the specified status code.static HttpStatus
Returns theHttpStatus
represented by the specified status text.
-
Field Details
-
CONTINUE
100 Continue. -
SWITCHING_PROTOCOLS
101 Switching Protocols. -
PROCESSING
102 Processing (WebDAV, RFC2518). -
OK
200 OK. -
CREATED
201 Created. -
ACCEPTED
202 Accepted. -
NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1). -
NO_CONTENT
204 No Content. -
RESET_CONTENT
205 Reset Content. -
PARTIAL_CONTENT
206 Partial Content. -
MULTI_STATUS
207 Multi-Status (WebDAV, RFC2518). -
MULTIPLE_CHOICES
300 Multiple Choices. -
MOVED_PERMANENTLY
301 Moved Permanently. -
FOUND
302 Found. -
SEE_OTHER
303 See Other (since HTTP/1.1). -
NOT_MODIFIED
304 Not Modified. -
USE_PROXY
305 Use Proxy (since HTTP/1.1). -
TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1). -
BAD_REQUEST
400 Bad Request. -
UNAUTHORIZED
401 Unauthorized. -
PAYMENT_REQUIRED
402 Payment Required. -
FORBIDDEN
403 Forbidden. -
NOT_FOUND
404 Not Found. -
METHOD_NOT_ALLOWED
405 Method Not Allowed. -
NOT_ACCEPTABLE
406 Not Acceptable. -
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required. -
REQUEST_TIMEOUT
408 Request Timeout. -
CONFLICT
409 Conflict. -
GONE
410 Gone. -
LENGTH_REQUIRED
411 Length Required. -
PRECONDITION_FAILED
412 Precondition Failed. -
REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large. -
REQUEST_URI_TOO_LONG
414 Request-URI Too Long. -
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type. -
REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable. -
EXPECTATION_FAILED
417 Expectation Failed. -
MISDIRECTED_REQUEST
421 Misdirected Request.- See Also:
-
UNPROCESSABLE_ENTITY
422 Unprocessable Entity (WebDAV, RFC4918). -
LOCKED
423 Locked (WebDAV, RFC4918). -
FAILED_DEPENDENCY
424 Failed Dependency (WebDAV, RFC4918). -
UNORDERED_COLLECTION
425 Unordered Collection (WebDAV, RFC3648). -
UPGRADE_REQUIRED
426 Upgrade Required (RFC2817). -
PRECONDITION_REQUIRED
428 Precondition Required (RFC6585). -
TOO_MANY_REQUESTS
429 Too Many Requests (RFC6585). -
REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large (RFC6585). -
CLIENT_CLOSED_REQUEST
499 Client Closed Request.- See Also:
-
INTERNAL_SERVER_ERROR
500 Internal Server Error. -
NOT_IMPLEMENTED
501 Not Implemented. -
BAD_GATEWAY
502 Bad Gateway. -
SERVICE_UNAVAILABLE
503 Service Unavailable. -
GATEWAY_TIMEOUT
504 Gateway Timeout. -
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported. -
VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates (RFC2295). -
INSUFFICIENT_STORAGE
507 Insufficient Storage (WebDAV, RFC4918). -
NOT_EXTENDED
510 Not Extended (RFC2774). -
NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required (RFC6585). -
UNKNOWN
A special status code '0' which represents that the response status is unknown.
-
-
Constructor Details
-
HttpStatus
Creates a new instance with the specified status code and its reason phrase.
-
-
Method Details
-
valueOf
Returns theHttpStatus
represented by the specified status code. -
valueOf
Returns theHttpStatus
represented by the specified status text.- Returns:
- the parsed
HttpStatus
, orUNKNOWN
if failed to parse. - See Also:
-
isContentAlwaysEmpty
public static boolean isContentAlwaysEmpty(int statusCode) Returnstrue
if the content of the response for the specified status code is expected to be always empty (204, 205 and 304 responses.) -
code
public int code()Returns the code of thisHttpStatus
. -
codeAsText
Returns the status code asString
. -
reasonPhrase
Returns the reason phrase of thisHttpStatus
. -
codeClass
Returns the class of thisHttpStatus
. -
toHttpData
-
isContentAlwaysEmpty
public boolean isContentAlwaysEmpty()Returnstrue
if the content of the response for thisHttpStatus
is expected to be always empty (204, 205 and 304 responses.)- See Also:
-
isInformational
public boolean isInformational()Returns whether theHttpStatus
is an information, with a status code of 1XX. -
isSuccess
public boolean isSuccess()Returns whether theHttpStatus
is a success, with a status code of 2XX. -
isRedirection
public boolean isRedirection()Returns whether theHttpStatus
is a redirection, with a status code of 3XX. -
isClientError
public boolean isClientError()Returns whether theHttpStatus
is a client error, with a status code of 4XX. -
isServerError
public boolean isServerError()Returns whether theHttpStatus
is a server error, with a status code of 5XX. -
isError
public boolean isError()Returns whether theHttpStatus
is an error. -
hashCode
public int hashCode() -
equals
Returns whether the specified object is "equal to" this status.Equality of
HttpStatus
only depends oncode()
. The reason phrase is not considered for equality. -
compareTo
Compares this status to the specified status.Equality of
HttpStatus
only depends oncode()
. The reason phrase is not considered for equality.- Specified by:
compareTo
in interfaceComparable<HttpStatus>
-
toString
-