Introduction

HTTP status codes indicate whether a specific HTTP request was completed successfully. The status codes are divided into five groups, which are informational responses, successful operations, redirects, client errors, and server errors.

Informational Responses

These status codes are returned while the current request is still being processed.

100 Continue

This status indicates that the request was accepted. The client can now continue with the request or ignore the response if the request is already complete.

101 Switching Protocols

This status code is returned in response to an Upgrade: request for the protocol when the server agrees to the switch.

Successful Operations

A status code from this group is returned when the request was successful.

200 OK

The request was completed successfully. The meaning of this status code depends on the HTTP method used.

  • With GET, the resource was requested and is transferred in the message body.
  • With HEAD, the message body contains the header.
  • With POST, the requested resource is attached to the message body as the result of the request.
  • With TRACE, the message body contains the request in the form in which it reached the server.

201 Created

The request was processed correctly and the resource was created. This status code is usually returned in response to a PUT request.

202 Accepted

The server has received and accepted the request but has not processed it yet. This status is intended for batch processing or for cases in which another server or process handles the request, because HTTP has no asynchronous responses.

203 Non-Authoritative Information

This status code indicates that the returned metadata does not come directly from the server and was copied from a third-party or local source instead. Apart from this condition, the status 200 OK should be used for this kind of response.

204 No Content

No content was sent in response to the request, but the header may provide important information. The user can update the cached header with the new data.

205 Reset Content

This status code is sent after the request to reset a document has been completed.

206 Partial Content

This status code is received when the client has sent a request to split the download into several streams.

Redirects

These HTTP status codes indicate that further steps are required to process the request correctly.

300 Multiple Choices

The request resulted in several valid responses. One of these responses contains a list so that the user can make a more precise choice.

301 Moved Permanently

The requested resource is not available because it has been moved permanently. The response may contain the new URI.

302 Found

The requested resource is not available because it has been moved temporarily. The original address remains valid and should continue to be used.

303 See Other

The server sends this status code when the resource requested with GET is provided at a different URI.

304 Not Modified

This status code is used in connection with cached data. It tells the client that the response has not changed and that the information from the cache is still valid.

305 Use Proxy

This status code indicates that a proxy is required to access the resource. Because of security concerns, it is rarely supported.

306 Unused

This status code is no longer used and is currently reserved. It was used in HTTP 1.1.

307 Temporary Redirect

A server sends this status code when the requested resource should be requested at a different URI with the same method. The status is similar to 302 Found, but here the client is prevented from changing the HTTP method. If the original request used POST, the second request must use POST as well.

308 Permanent Redirect

This status code indicates that the requested resource is permanently available at a different URI. The resource can be found at the address given in the Location: HTTP header. The status code works much like 301 Moved Permanently, except that here the client must not change the HTTP method. If POST was used originally, the second request also uses POST.

Client Errors

These status messages indicate an error on the client side that caused the request to fail.

400 Bad Request

The server could not understand the request because of malformed syntax.

401 Unauthorized

Valid authentication is required to process the request. If it is missing, the server rejects the client with this status code.

402 Payment Required

This status is reserved for future functions. It is intended for digital payment systems but is not currently in use.

403 Forbidden

The server refuses the request because the client lacks the necessary permissions (authorization).

404 Not Found

The server cannot find the requested resource. This status is one of the best known because it is often displayed for incorrect web addresses.

405 Method Not Allowed

The server knows the request method, but it has been disabled. This status can be returned for all methods except the two standard methods GET and HEAD.

406 Not Acceptable

This response is sent when the server, while looking for a response, finds no content that matches the client’s request.

407 Proxy Authentication Required

This status is similar to 401, but here authentication through a proxy is required.

408 Request Timeout

This status is sent to clients that have been inactive for a certain period of time. The message is sent without a request from the client. In this case the server wants to close the connection and free it up. The message appears more often in combination with certain browsers such as Chrome or IE9, because they use techniques that speed up browsing. Some servers also close inactive connections without this message.

409 Conflict

This message indicates a conflict between the request and the current state of the server.

410 Gone

This status code is returned when the requested resource has been removed from the server.

411 Length Required

The server rejected the request because the Content-Length, that is, the length of the content, was not defined in the header and the server requires it.

412 Precondition Failed

The client defined properties in the request header that are not compatible with the server.

413 Payload Too Large

The request is larger than the maximum specified by the server. The server may close the connection or send a Retry-After header.

414 URI Too Long

The URI requested by the client is longer than the server accepts.

415 Unsupported Media Type

The server rejected the request because the media format is not supported.

416 Requested Range Not Satisfiable

The value defined for Range in the header cannot be satisfied. The specified value may lie outside the maximum size of the target URI.

417 Expectation Failed

This status code indicates that the server cannot meet the value defined under Expect in the header.

421 Misdirected Request

The request was made in a way that the server cannot process. The server may be configured so that it cannot send responses to requests whose request URI consists of this combination of scheme and authority.

426 Upgrade Required

The server refuses to carry out the request with the current protocol. After an upgrade of the client protocol, the request may be carried out. With this status code, the server must name a compatible protocol type in the Upgrade header field.

428 Precondition Required

The origin server requires the request to be conditional. This is meant to prevent a conflict in which a client retrieves the state of a resource, changes it, and sends it back to the server while a third party has changed that state in the meantime.

429 Too Many Requests

The user has sent too many requests to the server in too short a time, which is why the server limits the number of requests.

431 Request Header Fields Too Large

The server refuses to process the request because the header field is too large. Once its size has been reduced, the request can be sent again and processed.

The resource requested by the user cannot be provided for legal reasons. It may, for example, be a web page that has been censored by the government.

Server Errors

These HTTP status codes indicate faulty processing on the server side. The request could not be processed correctly.

500 Internal Server Error

The server encountered an internal error that it cannot work around.

501 Not Implemented

The server does not support the request method and therefore cannot process the request. In general, servers are only required to support GET and HEAD.

502 Bad Gateway

While acting as a gateway, the server received an invalid response to a request, so processing was not possible.

503 Service Unavailable

The server is currently not available. Possible reasons for the temporary outage are maintenance work or overload. With Retry-After: in the header, the server can tell the client when the service will be available again.

504 Gateway Timeout

This status message appears when the server acts as a gateway and has not received a suitable response within the specified time.

505 HTTP Version Not Supported

The server does not support the HTTP version used in the request.

506 Variant Also Negotiates

An internal configuration error has occurred on the server. The request led to a circular reference that cannot be resolved.

508 Loop Detected

An internal error has occurred. The request led to a loop, which is why no valid start or end point could be determined.

511 Network Authentication Required

This status code indicates that the client must authenticate to gain access to the network.

Share LinkedIn X Email