Package io.servicetalk.http.api
Class HttpResponseStatus
- java.lang.Object
-
- io.servicetalk.http.api.HttpResponseStatus
-
public final class HttpResponseStatus extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpResponseStatus.StatusClass
The class of response status codes.
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
code()
Get the three digit status-code indicating status of the response.java.lang.CharSequence
codeAsCharSequence()
Get thecode()
as aCharSequence
.boolean
equals(java.lang.Object o)
int
hashCode()
static HttpResponseStatus
of(int statusCode, java.lang.String reasonPhrase)
static HttpResponseStatus
of(java.lang.CharSequence statusCode)
Convert fromCharSequence
toHttpResponseStatus
.java.lang.String
reasonPhrase()
Get the reason-phrase that provides a textual description associated with the numeric status code.HttpResponseStatus.StatusClass
statusClass()
Get theHttpResponseStatus.StatusClass
for thisHttpResponseStatus
.java.lang.String
toString()
void
writeTo(Buffer buffer)
Write the equivalent of thisHttpResponseStatus
to aBuffer
.
-
-
-
Field Detail
-
CONTINUE
public static final HttpResponseStatus CONTINUE
100 Continue- See Also:
- RFC7231, section 6.2.1
-
SWITCHING_PROTOCOLS
public static final HttpResponseStatus SWITCHING_PROTOCOLS
101 Switching Protocols- See Also:
- RFC7231, section 6.2.2
-
PROCESSING
public static final HttpResponseStatus PROCESSING
102 Processing- See Also:
- RFC2518, section 10.1
-
EARLY_HINTS
public static final HttpResponseStatus EARLY_HINTS
103 Early Hints- See Also:
- RFC8297, section 2
-
OK
public static final HttpResponseStatus OK
200 OK- See Also:
- RFC7231, section 6.3.1
-
CREATED
public static final HttpResponseStatus CREATED
201 Created- See Also:
- RFC7231, section 6.3.2
-
ACCEPTED
public static final HttpResponseStatus ACCEPTED
202 Accepted- See Also:
- RFC7231, section 6.3.3
-
NON_AUTHORITATIVE_INFORMATION
public static final HttpResponseStatus NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1)- See Also:
- RFC7231, section 6.3.4
-
NO_CONTENT
public static final HttpResponseStatus NO_CONTENT
204 No Content- See Also:
- RFC7231, section 6.3.5
-
RESET_CONTENT
public static final HttpResponseStatus RESET_CONTENT
205 Reset Content- See Also:
- RFC7231, section 6.3.6
-
PARTIAL_CONTENT
public static final HttpResponseStatus PARTIAL_CONTENT
206 Partial Content- See Also:
- RFC7233, section 4.1
-
MULTI_STATUS
public static final HttpResponseStatus MULTI_STATUS
207 Multi-Status- See Also:
- RFC4918, section 11.1
-
ALREADY_REPORTED
public static final HttpResponseStatus ALREADY_REPORTED
208 Already Reported- See Also:
- RFC5842, section 7.1
-
IM_USED
public static final HttpResponseStatus IM_USED
226 IM Used- See Also:
- RFC3229, section 10.4.1
-
MULTIPLE_CHOICES
public static final HttpResponseStatus MULTIPLE_CHOICES
300 Multiple Choices- See Also:
- RFC7231, section 6.4.1
-
MOVED_PERMANENTLY
public static final HttpResponseStatus MOVED_PERMANENTLY
301 Moved Permanently- See Also:
- RFC7231, section 6.4.2
-
FOUND
public static final HttpResponseStatus FOUND
302 Found- See Also:
- RFC7231, section 6.4.3
-
SEE_OTHER
public static final HttpResponseStatus SEE_OTHER
303 See Other (since HTTP/1.1)- See Also:
- RFC7231, section 6.4.4
-
NOT_MODIFIED
public static final HttpResponseStatus NOT_MODIFIED
304 Not Modified- See Also:
- RFC7232, section 4.1
-
USE_PROXY
public static final HttpResponseStatus USE_PROXY
305 Use Proxy (since HTTP/1.1)- See Also:
- RFC7231, section 6.4.5
-
TEMPORARY_REDIRECT
public static final HttpResponseStatus TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1)- See Also:
- RFC7231, section 6.4.7
-
PERMANENT_REDIRECT
public static final HttpResponseStatus PERMANENT_REDIRECT
308 Permanent Redirect- See Also:
- RFC7538, section 3
-
BAD_REQUEST
public static final HttpResponseStatus BAD_REQUEST
400 Bad Request- See Also:
- RFC7231, section 6.5.1
-
UNAUTHORIZED
public static final HttpResponseStatus UNAUTHORIZED
401 Unauthorized- See Also:
- RFC7235, section 3.1
-
PAYMENT_REQUIRED
public static final HttpResponseStatus PAYMENT_REQUIRED
402 Payment Required- See Also:
- RFC7231, section 6.5.2
-
FORBIDDEN
public static final HttpResponseStatus FORBIDDEN
403 Forbidden- See Also:
- RFC7231, section 6.5.3
-
NOT_FOUND
public static final HttpResponseStatus NOT_FOUND
404 Not Found- See Also:
- RFC7231, section 6.5.4
-
METHOD_NOT_ALLOWED
public static final HttpResponseStatus METHOD_NOT_ALLOWED
405 Method Not Allowed- See Also:
- RFC7231, section 6.5.5
-
NOT_ACCEPTABLE
public static final HttpResponseStatus NOT_ACCEPTABLE
406 Not Acceptable- See Also:
- RFC7231, section 6.5.6
-
PROXY_AUTHENTICATION_REQUIRED
public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required- See Also:
- RFC7235, section 3.2
-
REQUEST_TIMEOUT
public static final HttpResponseStatus REQUEST_TIMEOUT
408 Request Timeout- See Also:
- RFC7231, section 6.5.7
-
CONFLICT
public static final HttpResponseStatus CONFLICT
409 Conflict- See Also:
- RFC7231, section 6.5.8
-
GONE
public static final HttpResponseStatus GONE
410 Gone- See Also:
- RFC7231, section 6.5.9
-
LENGTH_REQUIRED
public static final HttpResponseStatus LENGTH_REQUIRED
411 Length Required- See Also:
- RFC7231, section 6.5.10
-
PRECONDITION_FAILED
public static final HttpResponseStatus PRECONDITION_FAILED
412 Precondition Failed- See Also:
- RFC7232, section 4.2
-
PAYLOAD_TOO_LARGE
public static final HttpResponseStatus PAYLOAD_TOO_LARGE
413 Payload Too Large- See Also:
- RFC7231, section 6.5.11
-
URI_TOO_LONG
public static final HttpResponseStatus URI_TOO_LONG
414 URI Too Long- See Also:
- RFC7231, section 6.5.12
-
UNSUPPORTED_MEDIA_TYPE
public static final HttpResponseStatus UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type- See Also:
- RFC7231, section 6.5.13
-
RANGE_NOT_SATISFIABLE
public static final HttpResponseStatus RANGE_NOT_SATISFIABLE
416 Range Not Satisfiable- See Also:
- RFC7233, section 4.4
-
EXPECTATION_FAILED
public static final HttpResponseStatus EXPECTATION_FAILED
417 Expectation Failed- See Also:
- RFC7231, section 6.5.14
-
MISDIRECTED_REQUEST
public static final HttpResponseStatus MISDIRECTED_REQUEST
421 Misdirected Request- See Also:
- RFC7540, section 9.1.2
-
UNPROCESSABLE_ENTITY
public static final HttpResponseStatus UNPROCESSABLE_ENTITY
422 Unprocessable Entity- See Also:
- RFC4918, section 11.2
-
LOCKED
public static final HttpResponseStatus LOCKED
423 Locked- See Also:
- RFC4918, section 11.3
-
FAILED_DEPENDENCY
public static final HttpResponseStatus FAILED_DEPENDENCY
424 Failed Dependency- See Also:
- RFC4918, section 11.4
-
TOO_EARLY
public static final HttpResponseStatus TOO_EARLY
425 Too Early- See Also:
- RFC8470, section 5.2
-
UPGRADE_REQUIRED
public static final HttpResponseStatus UPGRADE_REQUIRED
426 Upgrade Required- See Also:
- RFC7231, section 6.5.15
-
PRECONDITION_REQUIRED
public static final HttpResponseStatus PRECONDITION_REQUIRED
428 Precondition Required- See Also:
- RFC6585, section 3
-
TOO_MANY_REQUESTS
public static final HttpResponseStatus TOO_MANY_REQUESTS
429 Too Many Requests- See Also:
- RFC6585, section 4
-
REQUEST_HEADER_FIELDS_TOO_LARGE
public static final HttpResponseStatus REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large- See Also:
- RFC6585, section 5
-
UNAVAILABLE_FOR_LEGAL_REASONS
public static final HttpResponseStatus UNAVAILABLE_FOR_LEGAL_REASONS
451 Unavailable For Legal Reasons- See Also:
- RFC7725, section 3
-
INTERNAL_SERVER_ERROR
public static final HttpResponseStatus INTERNAL_SERVER_ERROR
500 Internal Server Error- See Also:
- RFC7231, section 6.6.1
-
NOT_IMPLEMENTED
public static final HttpResponseStatus NOT_IMPLEMENTED
501 Not Implemented- See Also:
- RFC7231, section 6.6.2
-
BAD_GATEWAY
public static final HttpResponseStatus BAD_GATEWAY
502 Bad Gateway- See Also:
- RFC7231, section 6.6.3
-
SERVICE_UNAVAILABLE
public static final HttpResponseStatus SERVICE_UNAVAILABLE
503 Service Unavailable- See Also:
- RFC7231, section 6.6.4
-
GATEWAY_TIMEOUT
public static final HttpResponseStatus GATEWAY_TIMEOUT
504 Gateway Timeout- See Also:
- RFC7231, section 6.6.5
-
HTTP_VERSION_NOT_SUPPORTED
public static final HttpResponseStatus HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported- See Also:
- RFC7231, section 6.6.6
-
VARIANT_ALSO_NEGOTIATES
public static final HttpResponseStatus VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates- See Also:
- RFC2295, section 8.1
-
INSUFFICIENT_STORAGE
public static final HttpResponseStatus INSUFFICIENT_STORAGE
507 Insufficient Storage- See Also:
- RFC4918, section 11.5
-
LOOP_DETECTED
public static final HttpResponseStatus LOOP_DETECTED
508 Loop Detected- See Also:
- RFC5842, section 7.2
-
NOT_EXTENDED
public static final HttpResponseStatus NOT_EXTENDED
510 Not Extended- See Also:
- RFC2774, section 7
-
NETWORK_AUTHENTICATION_REQUIRED
public static final HttpResponseStatus NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required- See Also:
- RFC6585, section 6
-
-
Method Detail
-
of
public static HttpResponseStatus of(int statusCode, java.lang.String reasonPhrase)
Returns anHttpResponseStatus
for the specifiedstatusCode
andreasonPhrase
. Generally, the constants inHttpResponseStatus
should be used.- Parameters:
statusCode
- the three digit status-code indicating status of the responsereasonPhrase
- the reason-phrase portion of the response- Returns:
- an
HttpResponseStatus
-
of
public static HttpResponseStatus of(java.lang.CharSequence statusCode)
Convert fromCharSequence
toHttpResponseStatus
.- Parameters:
statusCode
- TheCharSequence
to convert, this is expected to be an integer value.- Returns:
- a
HttpResponseStatus
representation ofstatusCode
.
-
code
public int code()
Get the three digit status-code indicating status of the response.- Returns:
- the three digit status-code indicating status of the response
-
codeAsCharSequence
public java.lang.CharSequence codeAsCharSequence()
Get thecode()
as aCharSequence
.- Returns:
- the
code()
as aCharSequence
.
-
reasonPhrase
public java.lang.String reasonPhrase()
Get the reason-phrase that provides a textual description associated with the numeric status code.- Returns:
- the reason-phrase that provides a textual description associated with the numeric status code
-
writeTo
public void writeTo(Buffer buffer)
Write the equivalent of thisHttpResponseStatus
to aBuffer
.- Parameters:
buffer
- TheBuffer
to write to
-
statusClass
public HttpResponseStatus.StatusClass statusClass()
Get theHttpResponseStatus.StatusClass
for thisHttpResponseStatus
.- Returns:
- the
HttpResponseStatus.StatusClass
for thisHttpResponseStatus
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-