- All Implemented Interfaces:
Http.ResponseStatus
,Serializable
,Comparable<Http.Status>
,Constable
- Enclosing class:
- Http
Commonly used status codes defined by HTTP, see
HTTP/1.1 documentation
for the complete list. Additional status codes can be added by applications
by creating an implementation of
Http.ResponseStatus
.
Copied from JAX-RS.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface io.helidon.common.http.Http.ResponseStatus
Http.ResponseStatus.Family
-
Enum Constant Summary
Enum ConstantDescription202 Accepted, see HTTP/1.1 documentation .502 Bad Gateway, see HTTP/1.1 documentation.400 Bad Request, see HTTP/1.1 documentation.409 Conflict, see HTTP/1.1 documentation.100 Continue, see HTTP/1.1 documentations.201 Created, see HTTP/1.1 documentation.417 Expectation Failed, see HTTP/1.1 documentation.403 Forbidden, see HTTP/1.1 documentation.302 Found, see HTTP/1.1 documentation.504 Gateway Timeout, see HTTP/1.1 documentation.410 Gone, see HTTP/1.1 documentation.Deprecated, for removal: This API element is subject to removal in a future version.505 HTTP Version Not Supported, see HTTP/1.1 documentation.418 I'm a teapot, see Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0).500 Internal Server Error, see HTTP/1.1 documentation.411 Length Required, see HTTP/1.1 documentation.405 Method Not Allowed, see HTTP/1.1 documentation.301 Moved Permanently, see HTTP/1.1 documentation.204 No Content, see HTTP/1.1 documentation.406 Not Acceptable, see HTTP/1.1 documentation.404 Not Found, see HTTP/1.1 documentation.501 Not Implemented, see HTTP/1.1 documentation.304 Not Modified, see HTTP/1.1 documentation.200 OK, see HTTP/1.1 documentation.206 Reset Content, see HTTP/1.1 documentation.402 Payment Required, see HTTP/1.1 documentation.412 Precondition Failed, see HTTP/1.1 documentation.407 Proxy Authentication Required, see HTTP/1.1 documentation.413 Request Entity Too Large, see HTTP/1.1 documentation.408 Request Timeout, see HTTP/1.1 documentation.414 Request-URI Too Long, see HTTP/1.1 documentation.416 Requested Range Not Satisfiable, see HTTP/1.1 documentation.205 Reset Content, see HTTP/1.1 documentation.303 See Other, see HTTP/1.1 documentation.503 Service Unavailable, see HTTP/1.1 documentation.101 Switching Protocols, see HTTP/1.1 documentations.307 Temporary Redirect, see HTTP/1.1 documentation.401 Unauthorized, see HTTP/1.1 documentation.415 Unsupported Media Type, see HTTP/1.1 documentation.305 Use Proxy, see HTTP/1.1 documentation. -
Method Summary
Modifier and TypeMethodDescriptionint
code()
Get the associated status code.family()
Get the class of status code.static Optional<Http.Status>
find
(int statusCode) Convert a numerical status code into the correspondingStatus
enum value.Get the reason phrase.toString()
Get the response status as string.static Http.Status
Returns the enum constant of this class with the specified name.static Http.Status[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTINUE_100
100 Continue, see HTTP/1.1 documentations. -
SWITCHING_PROTOCOLS_101
101 Switching Protocols, see HTTP/1.1 documentations. -
OK_200
200 OK, see HTTP/1.1 documentation. -
CREATED_201
201 Created, see HTTP/1.1 documentation. -
ACCEPTED_202
202 Accepted, see HTTP/1.1 documentation . -
NO_CONTENT_204
204 No Content, see HTTP/1.1 documentation. -
RESET_CONTENT_205
205 Reset Content, see HTTP/1.1 documentation.- Since:
- 2.0
-
PARTIAL_CONTENT_206
206 Reset Content, see HTTP/1.1 documentation.- Since:
- 2.0
-
MOVED_PERMANENTLY_301
301 Moved Permanently, see HTTP/1.1 documentation. -
FOUND_302
302 Found, see HTTP/1.1 documentation.- Since:
- 2.0
-
SEE_OTHER_303
303 See Other, see HTTP/1.1 documentation. -
NOT_MODIFIED_304
304 Not Modified, see HTTP/1.1 documentation. -
USE_PROXY_305
305 Use Proxy, see HTTP/1.1 documentation.- Since:
- 2.0
-
TEMPORARY_REDIRECT_307
307 Temporary Redirect, see HTTP/1.1 documentation. -
BAD_REQUEST_400
400 Bad Request, see HTTP/1.1 documentation. -
UNAUTHORIZED_401
401 Unauthorized, see HTTP/1.1 documentation. -
PAYMENT_REQUIRED_402
402 Payment Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
FORBIDDEN_403
403 Forbidden, see HTTP/1.1 documentation. -
NOT_FOUND_404
404 Not Found, see HTTP/1.1 documentation. -
METHOD_NOT_ALLOWED_405
405 Method Not Allowed, see HTTP/1.1 documentation.- Since:
- 2.0
-
NOT_ACCEPTABLE_406
406 Not Acceptable, see HTTP/1.1 documentation. -
PROXY_AUTHENTICATION_REQUIRED_407
407 Proxy Authentication Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
REQUEST_TIMEOUT_408
408 Request Timeout, see HTTP/1.1 documentation.- Since:
- 2.0
-
CONFLICT_409
409 Conflict, see HTTP/1.1 documentation. -
GONE_410
410 Gone, see HTTP/1.1 documentation. -
LENGTH_REQUIRED_411
411 Length Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
PRECONDITION_FAILED_412
412 Precondition Failed, see HTTP/1.1 documentation. -
REQUEST_ENTITY_TOO_LARGE_413
413 Request Entity Too Large, see HTTP/1.1 documentation.- Since:
- 2.0
-
REQUEST_URI_TOO_LONG_414
414 Request-URI Too Long, see HTTP/1.1 documentation.- Since:
- 2.0
-
UNSUPPORTED_MEDIA_TYPE_415
415 Unsupported Media Type, see HTTP/1.1 documentation. -
REQUESTED_RANGE_NOT_SATISFIABLE_416
416 Requested Range Not Satisfiable, see HTTP/1.1 documentation.- Since:
- 2.0
-
EXPECTATION_FAILED_417
417 Expectation Failed, see HTTP/1.1 documentation.- Since:
- 2.0
-
I_AM_A_TEAPOT
418 I'm a teapot, see Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0). -
INTERNAL_SERVER_ERROR_500
500 Internal Server Error, see HTTP/1.1 documentation. -
NOT_IMPLEMENTED_501
501 Not Implemented, see HTTP/1.1 documentation.- Since:
- 2.0
-
BAD_GATEWAY_502
502 Bad Gateway, see HTTP/1.1 documentation.- Since:
- 2.0
-
SERVICE_UNAVAILABLE_503
503 Service Unavailable, see HTTP/1.1 documentation. -
GATEWAY_TIMEOUT_504
504 Gateway Timeout, see HTTP/1.1 documentation.- Since:
- 2.0
-
HTTP_VERSION_NOT_SUPPORTED
@Deprecated(forRemoval=true, since="3.0.3") public static final Http.Status HTTP_VERSION_NOT_SUPPORTEDDeprecated, for removal: This API element is subject to removal in a future version.useHTTP_VERSION_NOT_SUPPORTED_505
instead (inconsistent name)505 HTTP Version Not Supported, see HTTP/1.1 documentation.- Since:
- 2.0
-
HTTP_VERSION_NOT_SUPPORTED_505
505 HTTP Version Not Supported, see HTTP/1.1 documentation.- Since:
- 3.0.3
-
-
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
-
find
Convert a numerical status code into the correspondingStatus
enum value.As opposed to
Http.ResponseStatus.create(int)
, this method returnsno value
for an unknown status code not represented by a value in this enumeration of standard HTTP response status codes.- Parameters:
statusCode
- the numerical status code.- Returns:
- optionally the matching Status if a matching
Status
value is defined.
-
family
Get the class of status code.- Specified by:
family
in interfaceHttp.ResponseStatus
- Returns:
- the class of status code.
-
code
public int code()Get the associated status code.- Specified by:
code
in interfaceHttp.ResponseStatus
- Returns:
- the status code.
-
reasonPhrase
Get the reason phrase.- Specified by:
reasonPhrase
in interfaceHttp.ResponseStatus
- Returns:
- the reason phrase.
-
toString
Get the response status as string.- Overrides:
toString
in classEnum<Http.Status>
- Returns:
- the response status string in the form of a partial HTTP response status line,
i.e.
"Status-Code SP Reason-Phrase"
.
-
HTTP_VERSION_NOT_SUPPORTED_505
instead (inconsistent name)