Common HTTP Status Codes

This post provides a list of commonly used HTTP status codes or response codes as part of the communication between a client and a web server. It also provides the description and usage of these status codes. The web server replies to the client request by sending the appropriate response code based on the request and response generated by the server.

Class 1xx - Informational

The class 1xx status codes are to acknowledge that the request has been received, understood by the server, and to continue for further processing the request.

100 - Continue

The server has received the request headers and the client can continue further sending the request body where required.

101 - Switching Protocols

The client has asked the server to switch the protocol and the server agreed to do so using the Upgrade header message field. The server will switch protocols and specify the same in response's Upgrade header field.

102 - Processing

The server is taking the time to process the request and updates the client to wait until the server process the request without timing out the request.

Class 2xx - Success

The class 2xx status codes are to acknowledge that the request was received, understood, and accepted by the server.

200 - OK

The server successfully processed the request and generates and sends the response depending on the type of request.

201 - Created

The request has been fulfilled resulting in one or more resources and the newly created resources are included in the response body.

202 - Accepted

The request has been accepted for further processing without any indication of end results.

203 - Non-Authoritative Information

This status code exists since HTTP/1.1 and used to indicate that the request was successful, but returning a modified version of the Server response. The modification will be done by a transforming proxy.

204 - No Content

The request has been processed successfully and the Server is not returning any content to the requestor.

205 - Reset Content

Similar to 204, the request has been processed successfully and the Server is not returning any content to the requestor. The requestor must reset the document view.

Class 3xx - Redirection

The class 3xx status codes specify that the client must take additional steps to complete the request. Most of the statuses in this class are for URL redirection.

300 - Multiple Choices

This redirect status indicates that the request sent by the client has more than one possible response. The client has to choose one possible response.

301 - Moved Permanently

This status indicates that the current request and all subsequent requests should be redirected to the URL given by the Location Header.

302 - Found

It indicates that the requested resource has been temporarily moved to the new location specified in the Location Header. It was previously called Moved Temporarily.

303 - See Other

As the name indicates, the response to the initial request can be looked at another URL/URI using a GET request.

304 - Not Modified

It indicates that the client can use the previous response sent by the Server for the same request since it's not modified on the server-side. There won't be any message body to the response sent by the server.

307 - Temporary Redirect

The requested page has moved temporarily to a new URL. It indicates that the client should use the temporary URL provided by the Location Header for the current request, but the future requests should use the original URL. As compared to 303, it guarantees that the method and the body will not be changed when the redirected request is made.

308 - Permanent Redirect

It works similar to 307 with the difference that the future requests should use the new URL provided by the Location Header. It also indicates that the Search Engines must update their links to the new URL.

Class 4xx - Client Error

The class 4xx status codes are used to represent the errors caused by the client.

400 - Bad Request

The server did not understand the request and cannot or will not process the request due to something that is interpreted as the client error including malformed request syntax, invalid message request framing, size too large, etc.

401 - Unauthorized

This client error status code is similar to 400 but used when invalid authentication is provided by the client or the authentication failed due to lack of valid credentials.

402 - Payment Required

Though this status code is reserved for the future but used by Google, Shopify, etc to ask the user to complete the payment in order to access the resources.

403 - Forbidden

This status code indicates that the request is valid, but the user lacks appropriate permissions to access the resource despite providing the valid authentication. It indicates that access is forbidden to the resource requested by the client.

404 - Not Found

The well-known status code used to notify the client that the requested resource is not available.

405 - Method Not Allowed

The HTTP method requested by the client is not supported for the request. For example - the server denies GET request where POST request is required.

406 - Not Acceptable

The resource requested by the client can only generate a response which is not acceptable according to the headers sent by the client. These headers include Accept, Accept-Charset, etc.

407 - Proxy Authentication Required

This client error status response code indicates that the client must authenticate itself with the proxy before the server process the request.

408 - Request Timeout

It indicates that the server timed out waiting for the client request. The server closes the connection instead of waiting for the client.

409 - Conflict

It indicates that the server cannot process the request because of conflict in the current state of the resource.

410 - Gone

It indicates that the server cannot process the request because of conflict in the current state of the resource.

415 - Unsupported Media Type

The server will not accept the request since the media type is not supported by the server.

411 - Length Required

This client request error status code indicates that the request does not specify the content length which is required by the requested resource.

418 - I'm a teapot

This is a special HTTP status code indicating that the server refuses to brew coffee because it is a teapot. It's a reference for Hyper Text Coffee Pot Control and it was defined in 1998 as one of the traditional IETF April Fools' jokes. It's not intended to be actually implemented by the web servers.

429 - Too Many Requests

It indicates that the client has sent too many requests in a given amount of time and used to limit the rate at which the resource can be accessed.

Class 5xx - Server Error

The class 5xx status codes are used to indicate errors on the server-side processing.

500 - Internal Server Error

It indicates that an exception has occurred on the server-side and the server cannot further process the request.

501 - Not Implemented

This server error response code indicates that the server cannot process the request since it does not support the functionality required to process the request.

502 - Bad Gateway

The server(acting as gateway or proxy) processing the request did not receive a valid response from the upstream server.

503 - Service Unavailable

The server cannot handle the request most probably due to heavy load or not available to process the request.

504 - Service Unavailable

The server(acting as gateway or proxy) processing the request did not receive the response in a timely manner from the upstream server.

505 - HTTP Version Not Supported

It indicates that the HTTP version used by the client in the request is not supported by the server.

Summary

This post provided the commonly used status codes and response codes sent by the web servers in response to the HTTP requests sent by the client applications including the browsers.