Package io.netty.handler.codec.http
Class HttpResponseStatus
java.lang.Object
io.netty.handler.codec.http.HttpResponseStatus
- All Implemented Interfaces:
Comparable<HttpResponseStatus>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpResponseStatus
202 Acceptedstatic final HttpResponseStatus
502 Bad Gatewaystatic final HttpResponseStatus
400 Bad Requestprivate final byte[]
private final int
private final AsciiString
private final HttpStatusClass
static final HttpResponseStatus
409 Conflictstatic final HttpResponseStatus
100 Continuestatic final HttpResponseStatus
201 Createdstatic final HttpResponseStatus
103 Early Hints (RFC 8297)static final HttpResponseStatus
417 Expectation Failedstatic final HttpResponseStatus
424 Failed Dependency (WebDAV, RFC4918)static final HttpResponseStatus
403 Forbiddenstatic final HttpResponseStatus
302 Foundstatic final HttpResponseStatus
504 Gateway Timeoutstatic final HttpResponseStatus
410 Gonestatic final HttpResponseStatus
505 HTTP Version Not Supportedstatic final HttpResponseStatus
507 Insufficient Storage (WebDAV, RFC4918)static final HttpResponseStatus
500 Internal Server Errorstatic final HttpResponseStatus
411 Length Requiredstatic final HttpResponseStatus
423 Locked (WebDAV, RFC4918)static final HttpResponseStatus
405 Method Not Allowedstatic final HttpResponseStatus
421 Misdirected Requeststatic final HttpResponseStatus
301 Moved Permanentlystatic final HttpResponseStatus
207 Multi-Status (WebDAV, RFC2518)static final HttpResponseStatus
300 Multiple Choicesstatic final HttpResponseStatus
511 Network Authentication Required (RFC6585)static final HttpResponseStatus
204 No Contentstatic final HttpResponseStatus
203 Non-Authoritative Information (since HTTP/1.1)static final HttpResponseStatus
406 Not Acceptablestatic final HttpResponseStatus
510 Not Extended (RFC2774)static final HttpResponseStatus
404 Not Foundstatic final HttpResponseStatus
501 Not Implementedstatic final HttpResponseStatus
304 Not Modifiedstatic final HttpResponseStatus
200 OKstatic final HttpResponseStatus
206 Partial Contentstatic final HttpResponseStatus
402 Payment Requiredstatic final HttpResponseStatus
308 Permanent Redirect (RFC7538)static final HttpResponseStatus
412 Precondition Failedstatic final HttpResponseStatus
428 Precondition Required (RFC6585)static final HttpResponseStatus
102 Processing (WebDAV, RFC2518)static final HttpResponseStatus
407 Proxy Authentication Requiredprivate final String
static final HttpResponseStatus
413 Request Entity Too Largestatic final HttpResponseStatus
431 Request Header Fields Too Large (RFC6585)static final HttpResponseStatus
408 Request Timeoutstatic final HttpResponseStatus
414 Request-URI Too Longstatic final HttpResponseStatus
416 Requested Range Not Satisfiablestatic final HttpResponseStatus
205 Reset Contentstatic final HttpResponseStatus
303 See Other (since HTTP/1.1)static final HttpResponseStatus
503 Service Unavailablestatic final HttpResponseStatus
101 Switching Protocolsstatic final HttpResponseStatus
307 Temporary Redirect (since HTTP/1.1)static final HttpResponseStatus
429 Too Many Requests (RFC6585)static final HttpResponseStatus
401 Unauthorizedstatic final HttpResponseStatus
425 Unordered Collection (WebDAV, RFC3648)static final HttpResponseStatus
422 Unprocessable Entity (WebDAV, RFC4918)static final HttpResponseStatus
415 Unsupported Media Typestatic final HttpResponseStatus
426 Upgrade Required (RFC2817)static final HttpResponseStatus
305 Use Proxy (since HTTP/1.1)static final HttpResponseStatus
506 Variant Also Negotiates (RFC2295) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
HttpResponseStatus
(int code) Creates a new instance with the specifiedcode
and the auto-generated default reason phrase.HttpResponseStatus
(int code, String reasonPhrase) Creates a new instance with the specifiedcode
and itsreasonPhrase
.private
HttpResponseStatus
(int code, String reasonPhrase, boolean bytes) -
Method Summary
Modifier and TypeMethodDescriptionint
code()
Returns the code of thisHttpResponseStatus
.Returns the status code asAsciiString
.Returns the class of thisHttpResponseStatus
int
Equality ofHttpResponseStatus
only depends oncode()
.(package private) void
boolean
Equality ofHttpResponseStatus
only depends oncode()
.int
hashCode()
private static HttpResponseStatus
static HttpResponseStatus
parseLine
(AsciiString line) Parses the specified HTTP status line into aHttpResponseStatus
.static HttpResponseStatus
parseLine
(CharSequence line) Parses the specified HTTP status line into aHttpResponseStatus
.static HttpResponseStatus
Parses the specified HTTP status line into aHttpResponseStatus
.Returns the reason phrase of thisHttpResponseStatus
.toString()
static HttpResponseStatus
valueOf
(int code) Returns theHttpResponseStatus
represented by the specified code.static HttpResponseStatus
private static HttpResponseStatus
valueOf0
(int code)
-
Field Details
-
CONTINUE
100 Continue -
SWITCHING_PROTOCOLS
101 Switching Protocols -
PROCESSING
102 Processing (WebDAV, RFC2518) -
EARLY_HINTS
103 Early Hints (RFC 8297) -
OK
200 OK -
CREATED
201 Created -
ACCEPTED
202 Accepted -
NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1) -
NO_CONTENT
204 No Content -
RESET_CONTENT
205 Reset Content -
PARTIAL_CONTENT
206 Partial Content -
MULTI_STATUS
207 Multi-Status (WebDAV, RFC2518) -
MULTIPLE_CHOICES
300 Multiple Choices -
MOVED_PERMANENTLY
301 Moved Permanently -
FOUND
302 Found -
SEE_OTHER
303 See Other (since HTTP/1.1) -
NOT_MODIFIED
304 Not Modified -
USE_PROXY
305 Use Proxy (since HTTP/1.1) -
TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1) -
PERMANENT_REDIRECT
308 Permanent Redirect (RFC7538) -
BAD_REQUEST
400 Bad Request -
UNAUTHORIZED
401 Unauthorized -
PAYMENT_REQUIRED
402 Payment Required -
FORBIDDEN
403 Forbidden -
NOT_FOUND
404 Not Found -
METHOD_NOT_ALLOWED
405 Method Not Allowed -
NOT_ACCEPTABLE
406 Not Acceptable -
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required -
REQUEST_TIMEOUT
408 Request Timeout -
CONFLICT
409 Conflict -
GONE
410 Gone -
LENGTH_REQUIRED
411 Length Required -
PRECONDITION_FAILED
412 Precondition Failed -
REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large -
REQUEST_URI_TOO_LONG
414 Request-URI Too Long -
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type -
REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable -
EXPECTATION_FAILED
417 Expectation Failed -
MISDIRECTED_REQUEST
421 Misdirected Request- See Also:
-
UNPROCESSABLE_ENTITY
422 Unprocessable Entity (WebDAV, RFC4918) -
LOCKED
423 Locked (WebDAV, RFC4918) -
FAILED_DEPENDENCY
424 Failed Dependency (WebDAV, RFC4918) -
UNORDERED_COLLECTION
425 Unordered Collection (WebDAV, RFC3648) -
UPGRADE_REQUIRED
426 Upgrade Required (RFC2817) -
PRECONDITION_REQUIRED
428 Precondition Required (RFC6585) -
TOO_MANY_REQUESTS
429 Too Many Requests (RFC6585) -
REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large (RFC6585) -
INTERNAL_SERVER_ERROR
500 Internal Server Error -
NOT_IMPLEMENTED
501 Not Implemented -
BAD_GATEWAY
502 Bad Gateway -
SERVICE_UNAVAILABLE
503 Service Unavailable -
GATEWAY_TIMEOUT
504 Gateway Timeout -
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported -
VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates (RFC2295) -
INSUFFICIENT_STORAGE
507 Insufficient Storage (WebDAV, RFC4918) -
NOT_EXTENDED
510 Not Extended (RFC2774) -
NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required (RFC6585) -
code
private final int code -
codeAsText
-
codeClass
-
reasonPhrase
-
bytes
private final byte[] bytes
-
-
Constructor Details
-
HttpResponseStatus
private HttpResponseStatus(int code) Creates a new instance with the specifiedcode
and the auto-generated default reason phrase. -
HttpResponseStatus
Creates a new instance with the specifiedcode
and itsreasonPhrase
. -
HttpResponseStatus
-
-
Method Details
-
newStatus
-
valueOf
Returns theHttpResponseStatus
represented by the specified code. If the specified code is a standard HTTP status code, a cached instance will be returned. Otherwise, a new instance will be returned. -
valueOf0
-
valueOf
Returns theHttpResponseStatus
represented by the specifiedcode
andreasonPhrase
. If the specified code is a standard HTTP statuscode
andreasonPhrase
, a cached instance will be returned. Otherwise, a new instance will be returned.- Parameters:
code
- The response code value.reasonPhrase
- The response code reason phrase.- Returns:
- the
HttpResponseStatus
represented by the specifiedcode
andreasonPhrase
.
-
parseLine
Parses the specified HTTP status line into aHttpResponseStatus
. The expected formats of the line are:statusCode
(e.g. 200)statusCode
reasonPhrase
(e.g. 404 Not Found)
- Throws:
IllegalArgumentException
- if the specified status line is malformed
-
parseLine
Parses the specified HTTP status line into aHttpResponseStatus
. The expected formats of the line are:statusCode
(e.g. 200)statusCode
reasonPhrase
(e.g. 404 Not Found)
- Throws:
IllegalArgumentException
- if the specified status line is malformed
-
parseLine
Parses the specified HTTP status line into aHttpResponseStatus
. The expected formats of the line are:statusCode
(e.g. 200)statusCode
reasonPhrase
(e.g. 404 Not Found)
- Throws:
IllegalArgumentException
- if the specified status line is malformed
-
code
public int code()Returns the code of thisHttpResponseStatus
. -
codeAsText
Returns the status code asAsciiString
. -
reasonPhrase
Returns the reason phrase of thisHttpResponseStatus
. -
codeClass
Returns the class of thisHttpResponseStatus
-
hashCode
public int hashCode() -
equals
Equality ofHttpResponseStatus
only depends oncode()
. The reason phrase is not considered for equality. -
compareTo
Equality ofHttpResponseStatus
only depends oncode()
. The reason phrase is not considered for equality.- Specified by:
compareTo
in interfaceComparable<HttpResponseStatus>
-
toString
-
encode
-