java.lang.Object
io.helidon.http.Status
Commonly used status codes defined by HTTP, see
HTTP/1.1 documentation.
Additional status codes can be added by applications
by call
create(int) or create(int, String) with unknown status code, or with text
that differs from the predefined status codes.
Although the constants are instances of this class, they can be compared using instance equality, as the only
way to obtain an instance is through methods create(int) create(int, String), which ensures
the same instance is returned for known status codes and reason phrases.
A good reference is the IANA list of HTTP Status Codes (we may not cover all of them in this type): IANA HTTP Status Codes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration representing the class of status code. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Status202 Accepted, see HTTP/1.1 documentation .static final Status502 Bad Gateway, see HTTP/1.1 documentation.static final Status400 Bad Request, see HTTP/1.1 documentation.static final Status409 Conflict, see HTTP/1.1 documentation.static final Status100 Continue, see HTTP/1.1 documentations.static final Status201 Created, see HTTP/1.1 documentation.static final Status417 Expectation Failed, see HTTP/1.1 documentation.static final StatusFailed dependency, see RFC 4918 - HTTP Extensions for WebDAV.static final Status403 Forbidden, see HTTP/1.1 documentation.static final Status302 Found, see HTTP/1.1 documentation.static final Status504 Gateway Timeout, see HTTP/1.1 documentation.static final Status410 Gone, see HTTP/1.1 documentation.static final Status505 HTTP Version Not Supported, see HTTP/1.1 documentation.static final Status418 I'm a teapot, see Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0).static final Status507 Insufficient Storage, see WebDAV documentation.static final Status500 Internal Server Error, see HTTP/1.1 documentation.static final Status411 Length Required, see HTTP/1.1 documentation.static final StatusLocked, see RFC 4918 - HTTP Extensions for WebDAV.static final Status508 Loop Detected, see RFC 5842 - Bindings for the Constrained Application Protocol (CoAP).static final Status405 Method Not Allowed, see HTTP/1.1 documentation.static final StatusMisdirected request, see RFC 9110 - Http Semantics.static final Status301 Moved Permanently, see HTTP/1.1 documentation.static final Status207 Multi-Status, see RFC 4918 - HTTP Extensions for WebDAV.static final Status511 Network Authentication Required, see RFC 6585 - Additional HTTP Status Codes.static final Status204 No Content, see HTTP/1.1 documentation.static final Status203 Non-Authoritative Information, see HTTP/1.1 documentation.static final Status406 Not Acceptable, see HTTP/1.1 documentation.static final Status510 Not Extended, see RFC 2774 - An HTTP Extension Framework.static final Status404 Not Found, see HTTP/1.1 documentation.static final Status501 Not Implemented, see HTTP/1.1 documentation.static final Status304 Not Modified, see HTTP/1.1 documentation.static final Status200 OK, see HTTP/1.1 documentation.static final Status206 Reset Content, see HTTP/1.1 documentation.static final Status402 Payment Required, see HTTP/1.1 documentation.static final Status308 Permanent Redirect, see HTTP Status Code 308 documentation.static final Status412 Precondition Failed, see HTTP/1.1 documentation.static final StatusPrecondition required, see RFC 6585 - Additional HTTP Status Codes.static final Status407 Proxy Authentication Required, see HTTP/1.1 documentation.static final Status413 Request Entity Too Large, see HTTP/1.1 documentation.static final Status408 Request Timeout, see HTTP/1.1 documentation.static final Status414 Request-URI Too Long, see HTTP/1.1 documentation.static final Status416 Requested Range Not Satisfiable, see HTTP/1.1 documentation.static final Status205 Reset Content, see HTTP/1.1 documentation.static final Status303 See Other, see HTTP/1.1 documentation.static final Status503 Service Unavailable, see HTTP/1.1 documentation.static final Status101 Switching Protocols, see HTTP/1.1 documentations.static final Status307 Temporary Redirect, see HTTP/1.1 documentation.static final StatusToo many requests, see RFC 6585 - Additional HTTP Status Codes.static final Status401 Unauthorized, see HTTP/1.1 documentation.static final StatusUnprocessable content, see RFC 9110 - Http Semantics.static final Status415 Unsupported Media Type, see HTTP/1.1 documentation.static final StatusUpgrade required, see RFC 9110 - Http Semantics.static final Status305 Use Proxy, see HTTP/1.1 documentation. -
Method Summary
Modifier and TypeMethodDescriptionintcode()Get the associated integer value representing the status code.codeText()Text of thecode().static Statuscreate(int statusCode) Convert a numerical status code into the corresponding Status.static StatusConvert a numerical status code into the corresponding Status.booleanfamily()Get the class of status code.inthashCode()Get the reason phrase.text()Text of the status as used in HTTP/1, such as "200 OK".toString()Get the response status as string.
-
Field 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 . -
NON_AUTHORITATIVE_INFORMATION_203
203 Non-Authoritative Information, see HTTP/1.1 documentation.- Since:
- 4.0.6
-
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
-
MULTI_STATUS_207
207 Multi-Status, see RFC 4918 - HTTP Extensions for WebDAV.- Since:
- 4.0.6
-
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. -
PERMANENT_REDIRECT_308
308 Permanent Redirect, see HTTP Status Code 308 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
418 I'm a teapot, see Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0). -
MISDIRECTED_REQUEST_421
Misdirected request, see RFC 9110 - Http Semantics. -
UNPROCESSABLE_CONTENT_422
Unprocessable content, see RFC 9110 - Http Semantics. -
LOCKED_423
Locked, see RFC 4918 - HTTP Extensions for WebDAV. -
FAILED_DEPENDENCY_424
Failed dependency, see RFC 4918 - HTTP Extensions for WebDAV. -
UPGRADE_REQUIRED_426
Upgrade required, see RFC 9110 - Http Semantics. -
PRECONDITION_REQUIRED_428
Precondition required, see RFC 6585 - Additional HTTP Status Codes. -
TOO_MANY_REQUESTS_429
Too many requests, see RFC 6585 - Additional HTTP Status Codes. -
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_505
505 HTTP Version Not Supported, see HTTP/1.1 documentation.- Since:
- 3.0.3
-
INSUFFICIENT_STORAGE_507
507 Insufficient Storage, see WebDAV documentation.- Since:
- 4.0.6
-
LOOP_DETECTED_508
508 Loop Detected, see RFC 5842 - Bindings for the Constrained Application Protocol (CoAP).- Since:
- 4.0.6
-
NOT_EXTENDED_510
510 Not Extended, see RFC 2774 - An HTTP Extension Framework.- Since:
- 4.0.6
-
NETWORK_AUTHENTICATION_REQUIRED_511
511 Network Authentication Required, see RFC 6585 - Additional HTTP Status Codes.- Since:
- 4.0.6
-
-
Method Details
-
create
Convert a numerical status code into the corresponding Status.For an unknown code, an ad-hoc
Statusis created.- Parameters:
statusCode- the numerical status code- Returns:
- the matching Status; either a constant from this class, or an ad-hoc
Status
-
create
Convert a numerical status code into the corresponding Status.It either returns an existing
Statusconstant if possible. For an unknown code, or code/reason phrase combination it creates an ad-hocStatus.- Parameters:
statusCode- the numerical status codereasonPhrase- the reason phrase; ifnullor a known reason phrase, an instance with the default phrase is returned; otherwise, a new instance is returned- Returns:
- the matching Status
-
code
public int code()Get the associated integer value representing the status code.- Returns:
- the integer value representing the status code.
-
family
Get the class of status code.- Returns:
- the class of status code.
-
reasonPhrase
Get the reason phrase.- Returns:
- the reason phrase.
-
codeText
Text of thecode().- Returns:
- code string (number as a string)
-
toString
Get the response status as string. -
text
Text of the status as used in HTTP/1, such as "200 OK".- Returns:
- text of this status
-
equals
-
hashCode
public int hashCode()
-