HTTP status codes are standard response codes given by web server software for every request made to the server. These codes indicate whether a specific HTTP request has been successfully completed, as well as the nature of the response. Responses are grouped into five classes:
- Informational responses (100–199)
- Successful responses (200–299)
- Redirection messages (300–399)
- Client error responses (400–499)
- Server error responses (500–599)
Understanding HTTP status codes is crucial for website developers and administrators to troubleshoot potential issues, optimize user experience, and ensure effective communication between the client and the server. Below is a cheat sheet of 25 important HTTP status codes across these categories that you might encounter on a regular basis.
Category | HTTP Status Code | Description |
---|---|---|
Informational | 100 Continue | The server has received the request headers, and the client should proceed to send the request body. |
Informational | 101 Switching Protocols | The requester has asked the server to switch protocols and the server has agreed to do so. |
Success | 200 OK | The request has succeeded. The information returned with the response is dependent on the method used in the request. |
Success | 201 Created | The request has been fulfilled, and a new resource is created. |
Success | 202 Accepted | The request has been accepted for processing, but the processing has not been completed. |
Success | 204 No Content | The server successfully processed the request, and is not returning any content. |
Redirection | 301 Moved Permanently | The URL of the requested resource has been changed permanently. The new URL is given in the response. |
Redirection | 302 Found | The server sent this response to direct the client to get the requested resource at another URI with a GET request. |
Redirection | 303 See Other | The server is redirecting to a different URI, which can be found by following the Location header. The response to the original request can be found under a different URI. |
Redirection | 304 Not Modified | There is no need to retransmit the requested resources. It is an implicit redirection to a cached resource. |
Redirection | 307 Temporary Redirect | The request should be repeated with another URI, but future requests can still use the original URI. |
Redirection | 308 Permanent Redirect | This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. |
Client Error | 400 Bad Request | The server could not understand the request due to invalid syntax. |
Client Error | 401 Unauthorized | The client must authenticate itself to get the requested response. |
Client Error | 403 Forbidden | 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. |
Client Error | 404 Not Found | The server can not find the requested resource. |
Client Error | 405 Method Not Allowed | The request method is known by the server but has been disabled and cannot be used. |
Client Error | 408 Request Timeout | The server would like to shut down this unused connection. |
Client Error | 409 Conflict | This response is sent when a request conflicts with the current state of the server. |
Client Error | 429 Too Many Requests | The user has sent too many requests in a given amount of time (“rate limiting”). |
Server Error | 500 Internal Server Error | The server has encountered a situation it doesn’t know how to handle. |
Server Error | 501 Not Implemented | The request method is not supported by the server and cannot be handled. |
Server Error | 502 Bad Gateway | The server was acting as a gateway or proxy and received an invalid response from the upstream server. |
Server Error | 503 Service Unavailable | The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. |
Server Error | 504 Gateway Timeout | The server was acting as a gateway or proxy and did not get a response from the upstream server. |