Package tech.becoming.common.constants
Class HttpStatusCode
- java.lang.Object
-
- tech.becoming.common.constants.HttpStatusCode
-
public class HttpStatusCode extends java.lang.ObjectConstants for the http status codes- See Also:
- HTTP response status codes
-
-
Field Summary
Fields Modifier and Type Field Description static intACCEPTED_202Successful responses (200–299)
The request has been received but not yet acted upon.static intALREADY_REPORTED_208Successful responses (200–299)
WebDAV
Used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection.static intBAD_GATEWAY_502Server errors (500–599)
This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.static intBAD_REQUEST_400Client errors (400–499)
The server could not understand the request due to invalid syntax.static intCONFLICT_409Client errors (400–499)
This response is sent when a request conflicts with the current state of the server.static intCONTINUE_100Informational responses (100–199)
This interim response indicates that everything so far is OK and that the client should continue the request, or ignore the response if the request is already finished.static intCREATED_201Successful responses (200–299)
The request has succeeded, and a new resource has been created as a result.static intEARLY_HITS_103Informational responses (100–199)
This status code is primarily intended to be used with the Link header, letting the user agent start preloading resources while the server prepares a response.static intEXPECTATION_FAILED_417Client errors (400–499)
This response code means the expectation indicated by the Expect request header field can't be met by the server.static intFAILED_DEPENDENCY_424Client errors (400–499)
WebDAV
The request failed due to failure of a previous request.static intFORBIDDEN_403Client errors (400–499)
The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource.static intFOUND_302Redirects (300–399)
This response code means that the URI of requested resource has been changed temporarily.static intGATEWAY_TIMEOUT_504Server errors (500–599)
This error response is given when the server is acting as a gateway and cannot get a response in time.static intGONE_410Client errors (400–499)
This response is sent when the requested content has been permanently deleted from server, with no forwarding address.static intHTTP_VERSION_NOT_SUPPORTED_505Server errors (500–599)
The HTTP version used in the request is not supported by the server.static intI_AM_A_TEAPOT_418Client errors (400–499)
The server refuses the attempt to brew coffee with a teapot.static intIM_USED_226Successful responses (200–299)
HTTP Delta encoding
The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.static intINSUFFICIENT_STORAGE_507Server errors (500–599)
WebDAV
The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.static intINTERNAL_SERVER_ERROR_500Server errors (500–599)
The server has encountered a situation it doesn't know how to handle.static intLENGTH_REQUIRED_411Client errors (400–499)
Server rejected the request because the Content-Length header field is not defined and the server requires it.static intLOCKED_423Client errors (400–499)
WebDAV
The resource that is being accessed is locked.static intLOOP_DETECTED_508Server errors (500–599)
The server detected an infinite loop while processing the request.static intMETHOD_NOT_ALLOWED_405Client errors (400–499)
The request method is known by the server but has been disabled and cannot be used.static intMISDIRECTED_REQUEST_421Client errors (400–499)
The request was directed at a server that is not able to produce a response.static intMOVED_PERMANENTLY_301Redirects (300–399)
The URL of the requested resource has been changed permanently.static intMULTI_STATUS_207Successful responses (200–299)
Conveys information about multiple resources, for situations where multiple status codes might be appropriate.static intMULTIPLE_CHOISES_300Redirects (300–399)
The request has more than one possible response.static intNET_EXTENDED_510Server errors (500–599)
Further extensions to the request are required for the server to fulfil it.static intNETWORK_AUTHENTICATION_REQUIRED_511Server errors (500–599)
The 511 status code indicates that the client needs to authenticate to gain network access.static intNO_CONTENT_204Successful responses (200–299)
There is no content to send for this request, but the headers may be useful.static intNON_AUTHORITATIVE_INFORMATION_203Successful responses (200–299)
This response code means the returned meta-information is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy.static intNOT_ACCEPTABLEClient errors (400–499)
This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent.static intNOT_FOUND_404Client errors (400–499)
The server can not find the requested resource.static intNOT_IMPLEMENTED_501Server errors (500–599)
The request method is not supported by the server and cannot be handled.static intNOT_MODIFIED_304Redirects (300–399)
This is used for caching purposes.static intOK_200Successful responses (200–299)
The request has succeeded.static intPARTIAL_CONTENT_206Successful responses (200–299)
This response code is used when the Range header is sent from the client to request only part of a resource.static intPAYLOAD_TOO_LARGE_413Client errors (400–499)
Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.static intPAYMENT_REQUIRED_402Client errors (400–499)
This response code is reserved for future use.static intPERMANENT_REDIRECT_308Redirects (300–399)
This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header.static intPRECONDITION_FAILEDClient errors (400–499)
The client has indicated preconditions in its headers which the server does not meet.static intPRECONDITION_REQUIRED_428Client errors (400–499)
The origin server requires the request to be conditional.static intPROCESSING_102Informational responses (100–199)
WebDAV
This code indicates that the server has received and is processing the request, but no response is available yet.static intPROXY_AUTHENTICATION_REQUIRED_407Client errors (400–499)
This is similar to 401 but authentication is needed to be done by a proxy.static intRANGE_NOT_SATISFIABLE_416Client errors (400–499)
The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's datastatic intREQUEST_HEADER_FIELDS_TOO_LARGE_431Client errors (400–499)
The server is unwilling to process the request because its header fields are too large.static intREQUEST_TIMEOUT_408Client errors (400–499)
This response is sent on an idle connection by some servers, even without any previous request by the client.static intREST_CONTENT_205Successful responses (200–299)
Tells the user-agent to reset the document which sent this request.static intSEE_OTHER_303Redirects (300–399)
The server sent this response to direct the client to get the requested resource at another URI with a GET request.static intSERVICE_UNAVAILABLE_503Server errors (500–599)
The server is not ready to handle the request.static intSWITCHING_PROTOCOL_101Informational responses (100–199)
This code is sent in response to an Upgrade request header from the client, and indicates the protocol the server is switching to.static intTEMPORARY_REDIRECT_307Redirects (300–399)
The server sends this response to direct the client to get the requested resource at another URI with same method that was used in the prior request.static intTOO_EARLY_425Client errors (400–499)
Indicates that the server is unwilling to risk processing a request that might be replayed.static intTOO_MANY_REQUESTS_429Client errors (400–499)
The user has sent too many requests in a given amount of time ("rate limiting").static intUNAUTHORIZED_401Client errors (400–499)
Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated".static intUNAVAILABLE_FOR_LEGAL_REASONS_451Client errors (400–499)
The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.static intUNPROCESSABLE_ENTITY_422Client errors (400–499)
WebDAV
The request was well-formed but was unable to be followed due to semantic errors.static intUNSUPPORTED_MEDIA_TYPE_415Client errors (400–499)
The media format of the requested data is not supported by the server, so the server is rejecting the request.static intUNUSED_306Deprecated.static intUPGRADE_REQUIRED_426Client errors (400–499)
The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.static intURI_TOO_LONG_414Client errors (400–499)
The URI requested by the client is longer than the server is willing to interpret.static intUSE_PROXY_305Deprecated.static intVARIANT_ALSO_NEGOTIATES_506Server errors (500–599)
The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
-
-
-
Field Detail
-
CONTINUE_100
public static final int CONTINUE_100
Informational responses (100–199)
This interim response indicates that everything so far is OK and that the client should continue the request, or ignore the response if the request is already finished.- See Also:
- Constant Field Values
-
SWITCHING_PROTOCOL_101
public static final int SWITCHING_PROTOCOL_101
Informational responses (100–199)
This code is sent in response to an Upgrade request header from the client, and indicates the protocol the server is switching to.- See Also:
- Constant Field Values
-
PROCESSING_102
public static final int PROCESSING_102
Informational responses (100–199)
WebDAV
This code indicates that the server has received and is processing the request, but no response is available yet.- See Also:
- Constant Field Values
-
EARLY_HITS_103
public static final int EARLY_HITS_103
Informational responses (100–199)
This status code is primarily intended to be used with the Link header, letting the user agent start preloading resources while the server prepares a response.- See Also:
- Constant Field Values
-
OK_200
public static final int OK_200
Successful responses (200–299)
The request has succeeded. The meaning of the success depends on the HTTP method:
GET: The resource has been fetched and is transmitted in the message body.
HEAD: The entity headers are in the message body.
PUT or POST: The resource describing the result of the action is transmitted in the message body.
TRACE: The message body contains the request message as received by the server- See Also:
- Constant Field Values
-
CREATED_201
public static final int CREATED_201
Successful responses (200–299)
The request has succeeded, and a new resource has been created as a result. This is typically the response sent after POST requests, or some PUT requests.- See Also:
- Constant Field Values
-
ACCEPTED_202
public static final int ACCEPTED_202
Successful responses (200–299)
The request has been received but not yet acted upon. It is noncommittal, since there is no way in HTTP to later send an asynchronous response indicating the outcome of the request. It is intended for cases where another process or server handles the request, or for batch processing.- See Also:
- Constant Field Values
-
NON_AUTHORITATIVE_INFORMATION_203
public static final int NON_AUTHORITATIVE_INFORMATION_203
Successful responses (200–299)
This response code means the returned meta-information is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy. This is mostly used for mirrors or backups of another resource. Except for that specific case, the "200 OK" response is preferred to this status.- See Also:
- Constant Field Values
-
NO_CONTENT_204
public static final int NO_CONTENT_204
Successful responses (200–299)
There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.- See Also:
- Constant Field Values
-
REST_CONTENT_205
public static final int REST_CONTENT_205
Successful responses (200–299)
Tells the user-agent to reset the document which sent this request.- See Also:
- Constant Field Values
-
PARTIAL_CONTENT_206
public static final int PARTIAL_CONTENT_206
Successful responses (200–299)
This response code is used when the Range header is sent from the client to request only part of a resource.- See Also:
- Constant Field Values
-
MULTI_STATUS_207
public static final int MULTI_STATUS_207
Successful responses (200–299)
Conveys information about multiple resources, for situations where multiple status codes might be appropriate.
WebDAV- See Also:
- Constant Field Values
-
ALREADY_REPORTED_208
public static final int ALREADY_REPORTED_208
Successful responses (200–299)
WebDAV
Used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection.- See Also:
- Constant Field Values
-
IM_USED_226
public static final int IM_USED_226
Successful responses (200–299)
HTTP Delta encoding
The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.- See Also:
- Constant Field Values
-
MULTIPLE_CHOISES_300
public static final int MULTIPLE_CHOISES_300
Redirects (300–399)
The request has more than one possible response. The user-agent or user should choose one of them. (There is no standardized way of choosing one of the responses, but HTML links to the possibilities are recommended so the user can pick.)- See Also:
- Constant Field Values
-
MOVED_PERMANENTLY_301
public static final int MOVED_PERMANENTLY_301
Redirects (300–399)
The URL of the requested resource has been changed permanently. The new URL is given in the response.- See Also:
- Constant Field Values
-
FOUND_302
public static final int FOUND_302
Redirects (300–399)
This response code means that the URI of requested resource has been changed temporarily. Further changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.- See Also:
- Constant Field Values
-
SEE_OTHER_303
public static final int SEE_OTHER_303
Redirects (300–399)
The server sent this response to direct the client to get the requested resource at another URI with a GET request.- See Also:
- Constant Field Values
-
NOT_MODIFIED_304
public static final int NOT_MODIFIED_304
Redirects (300–399)
This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.- See Also:
- Constant Field Values
-
USE_PROXY_305
@Deprecated public static final int USE_PROXY_305
Deprecated.Redirects (300–399)
Defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.- See Also:
- Constant Field Values
-
UNUSED_306
@Deprecated public static final int UNUSED_306
Deprecated.Redirects (300–399)
This response code is no longer used; it is just reserved. It was used in a previous version of the HTTP/1.1 specification.- See Also:
- Constant Field Values
-
TEMPORARY_REDIRECT_307
public static final int TEMPORARY_REDIRECT_307
Redirects (300–399)
The server sends this response to direct the client to get the requested resource at another URI with same method that was used in the prior request. This has the same semantics as the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: If a POST was used in the first request, a POST must be used in the second request.- See Also:
- Constant Field Values
-
PERMANENT_REDIRECT_308
public static final int PERMANENT_REDIRECT_308
Redirects (300–399)
This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: If a POST was used in the first request, a POST must be used in the second request.- See Also:
- Constant Field Values
-
BAD_REQUEST_400
public static final int BAD_REQUEST_400
Client errors (400–499)
The server could not understand the request due to invalid syntax.- See Also:
- Constant Field Values
-
UNAUTHORIZED_401
public static final int UNAUTHORIZED_401
Client errors (400–499)
Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.- See Also:
- Constant Field Values
-
PAYMENT_REQUIRED_402
public static final int PAYMENT_REQUIRED_402
Client errors (400–499)
This response code is reserved for future use. The initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists.- See Also:
- Constant Field Values
-
FORBIDDEN_403
public static final int FORBIDDEN_403
Client errors (400–499)
The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401, the client's identity is known to the server.- See Also:
- Constant Field Values
-
NOT_FOUND_404
public static final int NOT_FOUND_404
Client errors (400–499)
The server can not find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurrence on the web.- See Also:
- Constant Field Values
-
METHOD_NOT_ALLOWED_405
public static final int METHOD_NOT_ALLOWED_405
Client errors (400–499)
The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.- See Also:
- Constant Field Values
-
NOT_ACCEPTABLE
public static final int NOT_ACCEPTABLE
Client errors (400–499)
This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent.- See Also:
- Constant Field Values
-
PROXY_AUTHENTICATION_REQUIRED_407
public static final int PROXY_AUTHENTICATION_REQUIRED_407
Client errors (400–499)
This is similar to 401 but authentication is needed to be done by a proxy.- See Also:
- Constant Field Values
-
REQUEST_TIMEOUT_408
public static final int REQUEST_TIMEOUT_408
Client errors (400–499)
This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.- See Also:
- Constant Field Values
-
CONFLICT_409
public static final int CONFLICT_409
Client errors (400–499)
This response is sent when a request conflicts with the current state of the server.- See Also:
- Constant Field Values
-
GONE_410
public static final int GONE_410
Client errors (400–499)
This response is sent when the requested content has been permanently deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to indicate resources that have been deleted with this status code.- See Also:
- Constant Field Values
-
LENGTH_REQUIRED_411
public static final int LENGTH_REQUIRED_411
Client errors (400–499)
Server rejected the request because the Content-Length header field is not defined and the server requires it.- See Also:
- Constant Field Values
-
PRECONDITION_FAILED
public static final int PRECONDITION_FAILED
Client errors (400–499)
The client has indicated preconditions in its headers which the server does not meet.- See Also:
- Constant Field Values
-
PAYLOAD_TOO_LARGE_413
public static final int PAYLOAD_TOO_LARGE_413
Client errors (400–499)
Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.- See Also:
- Constant Field Values
-
URI_TOO_LONG_414
public static final int URI_TOO_LONG_414
Client errors (400–499)
The URI requested by the client is longer than the server is willing to interpret.- See Also:
- Constant Field Values
-
UNSUPPORTED_MEDIA_TYPE_415
public static final int UNSUPPORTED_MEDIA_TYPE_415
Client errors (400–499)
The media format of the requested data is not supported by the server, so the server is rejecting the request.- See Also:
- Constant Field Values
-
RANGE_NOT_SATISFIABLE_416
public static final int RANGE_NOT_SATISFIABLE_416
Client errors (400–499)
The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data- See Also:
- Constant Field Values
-
EXPECTATION_FAILED_417
public static final int EXPECTATION_FAILED_417
Client errors (400–499)
This response code means the expectation indicated by the Expect request header field can't be met by the server.- See Also:
- Constant Field Values
-
I_AM_A_TEAPOT_418
public static final int I_AM_A_TEAPOT_418
Client errors (400–499)
The server refuses the attempt to brew coffee with a teapot.- See Also:
- Constant Field Values
-
MISDIRECTED_REQUEST_421
public static final int MISDIRECTED_REQUEST_421
Client errors (400–499)
The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI.- See Also:
- Constant Field Values
-
UNPROCESSABLE_ENTITY_422
public static final int UNPROCESSABLE_ENTITY_422
Client errors (400–499)
WebDAV
The request was well-formed but was unable to be followed due to semantic errors.- See Also:
- Constant Field Values
-
LOCKED_423
public static final int LOCKED_423
Client errors (400–499)
WebDAV
The resource that is being accessed is locked.- See Also:
- Constant Field Values
-
FAILED_DEPENDENCY_424
public static final int FAILED_DEPENDENCY_424
Client errors (400–499)
WebDAV
The request failed due to failure of a previous request.- See Also:
- Constant Field Values
-
TOO_EARLY_425
public static final int TOO_EARLY_425
Client errors (400–499)
Indicates that the server is unwilling to risk processing a request that might be replayed.- See Also:
- Constant Field Values
-
UPGRADE_REQUIRED_426
public static final int UPGRADE_REQUIRED_426
Client errors (400–499)
The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server sends an Upgrade header in a 426 response to indicate the required protocol(s).- See Also:
- Constant Field Values
-
PRECONDITION_REQUIRED_428
public static final int PRECONDITION_REQUIRED_428
Client errors (400–499)
The origin server requires the request to be conditional. This response is intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.- See Also:
- Constant Field Values
-
TOO_MANY_REQUESTS_429
public static final int TOO_MANY_REQUESTS_429
Client errors (400–499)
The user has sent too many requests in a given amount of time ("rate limiting").- See Also:
- Constant Field Values
-
REQUEST_HEADER_FIELDS_TOO_LARGE_431
public static final int REQUEST_HEADER_FIELDS_TOO_LARGE_431
Client errors (400–499)
The server is unwilling to process the request because its header fields are too large. The request may be resubmitted after reducing the size of the request header fields.- See Also:
- Constant Field Values
-
UNAVAILABLE_FOR_LEGAL_REASONS_451
public static final int UNAVAILABLE_FOR_LEGAL_REASONS_451
Client errors (400–499)
The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.- See Also:
- Constant Field Values
-
INTERNAL_SERVER_ERROR_500
public static final int INTERNAL_SERVER_ERROR_500
Server errors (500–599)
The server has encountered a situation it doesn't know how to handle.- See Also:
- Constant Field Values
-
NOT_IMPLEMENTED_501
public static final int NOT_IMPLEMENTED_501
Server errors (500–599)
The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.- See Also:
- Constant Field Values
-
BAD_GATEWAY_502
public static final int BAD_GATEWAY_502
Server errors (500–599)
This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.- See Also:
- Constant Field Values
-
SERVICE_UNAVAILABLE_503
public static final int SERVICE_UNAVAILABLE_503
Server errors (500–599)
The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.- See Also:
- Constant Field Values
-
GATEWAY_TIMEOUT_504
public static final int GATEWAY_TIMEOUT_504
Server errors (500–599)
This error response is given when the server is acting as a gateway and cannot get a response in time.- See Also:
- Constant Field Values
-
HTTP_VERSION_NOT_SUPPORTED_505
public static final int HTTP_VERSION_NOT_SUPPORTED_505
Server errors (500–599)
The HTTP version used in the request is not supported by the server.- See Also:
- Constant Field Values
-
VARIANT_ALSO_NEGOTIATES_506
public static final int VARIANT_ALSO_NEGOTIATES_506
Server errors (500–599)
The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.- See Also:
- Constant Field Values
-
INSUFFICIENT_STORAGE_507
public static final int INSUFFICIENT_STORAGE_507
Server errors (500–599)
WebDAV
The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.- See Also:
- Constant Field Values
-
LOOP_DETECTED_508
public static final int LOOP_DETECTED_508
Server errors (500–599)
The server detected an infinite loop while processing the request.- See Also:
- Constant Field Values
-
NET_EXTENDED_510
public static final int NET_EXTENDED_510
Server errors (500–599)
Further extensions to the request are required for the server to fulfil it.- See Also:
- Constant Field Values
-
NETWORK_AUTHENTICATION_REQUIRED_511
public static final int NETWORK_AUTHENTICATION_REQUIRED_511
Server errors (500–599)
The 511 status code indicates that the client needs to authenticate to gain network access.- See Also:
- Constant Field Values
-
-