Enum HttpStatus
- All Implemented Interfaces:
Serializable, Comparable<HttpStatus>
An
Enumeration of all known HTTP status codes.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription400 - Bad Request409 - Conflict417 - Expectation Failed403 - Forbidden410 - Gone411 - Length Required405 - Method Not Allowed406 - Not Acceptable404 - Not Found412 - Precondition Failed407 - Proxy Authentication Required413 - Request Entity Too Large408 - Request Timeout414 - Bad Request416 - Requested Range Not Satisfiable401 - Unauthorized415 - Unsupported Media Type100 - Continue101 - Switching Protocols302 - Found / Moved Temporarily301 - Moved Permanently300 - Multiple Choices304 - Not Modified303 - See Others307 - Temporary Redirect305 - Use Proxy502 - Bad Gateway504 - Gateway Timeout505 - HTTP Version Not Supported500 - Internal Server Error501 - Not Implemented503 - Service Unavailable202 - Accepted201 - Created204 - No Content203 - Non-Authoritative Information200 - OK206 - Created205 - Reset Content -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateHttpStatus(int code, String phrase) Create an instance of this type. -
Method Summary
Modifier and TypeMethodDescriptionintcode()Retrieve the status code for this instance.line()Retrieve the status line for this instance.static HttpStatusReturns the enum constant of this type with the specified name.static HttpStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INFORMATIONAL_CONTINUE
100 - Continue -
INFORMATIONAL_SWITCHING_PROTOCOLS
101 - Switching Protocols -
SUCCESS_OK
200 - OK -
SUCCESS_CREATED
201 - Created -
SUCCESS_ACCEPTED
202 - Accepted -
SUCCESS_NON_AUTHORATIVE_INFORMATION
203 - Non-Authoritative Information -
SUCCESS_NO_CONTENT
204 - No Content -
SUCCESS_RESET_CONTENT
205 - Reset Content -
SUCCESS_PARTIAL_CONTENT
206 - Created -
REDIRECTION_MULTIPLE_CHOICES
300 - Multiple Choices -
REDIRECTION_MOVED_PERMANENTLY
301 - Moved Permanently -
REDIRECTION_FOUND
302 - Found / Moved Temporarily -
REDIRECTION_SEE_OTHER
303 - See Others -
REDIRECTION_NOT_MODIFIED
304 - Not Modified -
REDIRECTION_USE_PROXY
305 - Use Proxy -
REDIRECTION_TEMPORARILY_REDIRECT
307 - Temporary Redirect -
CLIENT_ERROR_BAD_REQUEST
400 - Bad Request -
CLIENT_ERROR_UNAUTHORIZED
401 - Unauthorized -
CLIENT_ERROR_FORBIDDEN
403 - Forbidden -
CLIENT_ERROR_NOT_FOUND
404 - Not Found -
CLIENT_ERROR_METHOD_NOT_ALLOWED
405 - Method Not Allowed -
CLIENT_ERROR_NOT_ACCEPTABLE
406 - Not Acceptable -
CLIENT_ERROR_PROXY_AUTHENTICATION_REQUIRED
407 - Proxy Authentication Required -
CLIENT_ERROR_REQUEST_TIMEOUT
408 - Request Timeout -
CLIENT_ERROR_CONFLICT
409 - Conflict -
CLIENT_ERROR_GONE
410 - Gone -
CLIENT_ERROR_LENGTH_REQUIRED
411 - Length Required -
CLIENT_ERROR_PRECONDITION_FAILED
412 - Precondition Failed -
CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE
413 - Request Entity Too Large -
CLIENT_ERROR_REQUEST_URI_TOO_LONG
414 - Bad Request -
CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE
415 - Unsupported Media Type -
CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE
416 - Requested Range Not Satisfiable -
CLIENT_ERROR_EXPECTATION_FAILED
417 - Expectation Failed -
SERVER_ERROR_INTERNAL_SERVER_ERROR
500 - Internal Server Error -
SERVER_ERROR_NOT_IMPLEMENTED
501 - Not Implemented -
SERVER_ERROR_BAD_GATEWAY
502 - Bad Gateway -
SERVER_ERROR_SERVICE_UNAVAILABLE
503 - Service Unavailable -
SERVER_ERROR_GATEWAY_TIMEOUT
504 - Gateway Timeout -
SERVER_ERROR_HTTP_VERSION_NOT_SUPPORTED
505 - HTTP Version Not Supported
-
-
Field Details
-
code
private int codeThe code associated with this status, for example "404" for "Not Found". -
line
The line associated with this status, "HTTP/1.1 501 Not Implemented".
-
-
Constructor Details
-
HttpStatus
Create an instance of this type.- Parameters:
code- the status code.phrase- the associated phrase.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
code
public int code()Retrieve the status code for this instance.- Returns:
- the status code.
-
line
-