Skip to content

HTTP Status Codes

The HTTP Status Code in a server’s response is a 3-digit integer indicating the outcome of the request. The first digit classifies the response type:

S.N.Code ClassDescription
11xx: InformationalRequest received, continuing process. These are interim responses, often followed by a final response.
22xx: SuccessThe action was successfully received, understood, and accepted.
33xx: RedirectionFurther action needs to be taken by the user agent to complete the request.
44xx: Client ErrorThe request contains bad syntax or cannot be fulfilled by the server.
55xx: Server ErrorThe server failed to fulfill an apparently valid request due to an error on the server.

HTTP status codes are extensible. While applications should be prepared to handle any status code by at least understanding its class, the following lists common and important codes.

Status Code & Reason PhraseDescription
100 ContinueThe server has received the request headers and the client should proceed to send the request body (e.g., in a POST request). Or, if the request is already finished, ignore this response.
101 Switching ProtocolsThe server is switching protocols as requested by the client (via an Upgrade header). Commonly used for WebSockets.
102 Processing (WebDAV)The server has received and is processing the request, but no response is available yet. Prevents the client from timing out.
103 Early HintsUsed to send some response headers before the final HTTP message. Allows a browser to start preloading resources while the server is still preparing the main response.
Status Code & Reason PhraseDescription
200 OKThe request has succeeded. The payload sent in a 200 response depends on the request method (e.g., resource for GET, status for HEAD).
201 CreatedThe request has been fulfilled, resulting in the creation of a new resource. The URI of the new resource is often returned in the Location header.
202 AcceptedThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon. Useful for asynchronous operations.
203 Non-Authoritative InformationThe returned meta-information is from a local or third-party copy, not from the origin server, and might be outdated.
204 No ContentThe server successfully processed the request but is not returning any content. Often used for DELETE requests or PUT requests where no body is returned.
205 Reset ContentThe server successfully processed the request, and tells the user agent to reset the document view which caused the request to be sent (e.g., clear a form).
206 Partial ContentThe server is delivering only part of the resource (byte serving) due to a Range header sent by the client.
Status Code & Reason PhraseDescription
300 Multiple ChoicesThe request has more than one possible response. The user agent or user should choose one of them. (Rarely used).
301 Moved PermanentlyThe target resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Search engines update their links.
302 FoundThe target resource resides temporarily under a different URI. As this redirection may be altered on occasion, the client SHOULD continue to use the effective request URI for future requests. Historically, browsers would change POST to GET on 302; use 303 or 307 for clearer semantics.
303 See OtherThe response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. Typically used after a POST to prevent re-submission.
304 Not ModifiedA conditional GET or HEAD request was received and the resource has not been modified. The client can use its cached version. No message body.
305 Use Proxy (Deprecated)The requested resource MUST be accessed through the proxy given by the Location field. Deprecated due to security concerns.
307 Temporary RedirectThe target resource resides temporarily under a different URI. The user agent MUST NOT change the request method if it makes an automatic redirection to that URI. (e.g., POST remains POST).
308 Permanent RedirectThe target resource has been assigned a new permanent URI. The user agent MUST NOT change the request method if it makes an automatic redirection to that URI. (e.g., POST remains POST).
Status Code & Reason PhraseDescription
400 Bad RequestThe server cannot or will not process the request due to something perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
401 UnauthorizedThe request has not been applied because it lacks valid authentication credentials for the target resource. Often accompanied by a WWW-Authenticate header.
402 Payment RequiredReserved for future use. Sometimes used by APIs to indicate a payment issue.
403 ForbiddenThe server understood the request but refuses to authorize it. Authentication will not help and the request SHOULD NOT be repeated.
404 Not FoundThe server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
405 Method Not AllowedThe method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.
406 Not AcceptableThe server cannot generate a response that matches the list of acceptable values defined in the request’s proactive content negotiation headers (e.g., Accept, Accept-Charset).
407 Proxy Authentication RequiredSimilar to 401, but indicates that the client must first authenticate itself with the proxy. The proxy MUST send a Proxy-Authenticate header field.
408 Request TimeoutThe server did not receive a complete request message within the time that it was prepared to wait.
409 ConflictThe request could not be completed due to a conflict with the current state of the target resource. Often used for PUT requests that would create a conflict.
410 GoneThe target resource is no longer available at the origin server and this condition is likely to be permanent. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead.
411 Length RequiredThe server refuses to accept the request without a defined Content-Length header.
412 Precondition FailedOne or more conditions given in the request header fields (e.g., If-Match, If-Unmodified-Since) evaluated to false when tested on the server.
413 Payload Too Large(Formerly Request Entity Too Large) The server is refusing to process a request because the request payload is larger than the server is willing or able to process.
414 URI Too Long(Formerly Request-URI Too Long) The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.
415 Unsupported Media TypeThe server is refusing to service the request because the payload is in a format not supported by this method on the target resource.
416 Range Not Satisfiable(Formerly Requested Range Not Satisfiable) The client has asked for a portion of the file (e.g., with a Range header), but the server cannot supply that portion.
417 Expectation FailedThe expectation given in an Expect request-header field could not be met by this server.
418 I’m a teapotAn April Fools’ joke RFC (RFC 2324). While humorous, it’s sometimes used by developers as an Easter egg or for specific error states.
422 Unprocessable Entity (WebDAV; RFC 4918)The server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions (e.g., semantic errors like invalid field values).
429 Too Many RequestsThe user has sent too many requests in a given amount of time (“rate limiting”). A Retry-After header might be included to indicate how long to wait before making a new request.
Status Code & Reason PhraseDescription
500 Internal Server ErrorA generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
501 Not ImplementedThe server does not recognize the request method or lacks the ability to fulfill the request. Usually this implies future availability (e.g., a new feature of a web service API).
502 Bad GatewayThe server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.
503 Service UnavailableThe server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. A Retry-After header might be included.
504 Gateway TimeoutThe server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request.
505 HTTP Version Not SupportedThe server does not support, or refuses to support, the HTTP protocol version that was used in the request message.