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