Understanding the Most Common HTTP Status Codes
- Published on
As you navigate the web, you’ll encounter various HTTP status codes. These codes are responses from the server indicating the status of a specific HTTP request. Understanding these codes is crucial for diagnosing and fixing issues in web development. Here’s a guide to the most common HTTP status codes and what they mean.
- 200 OK
The request has succeeded. The information is returned with the response.
- 201 Created
The request has been fulfilled, resulting in the creation of a new resource. This is typically the response sent after a POST request.
- 301 Moved Permanently
The resource requested has been permanently moved to a new URL. The new URL is provided in the response.
- 400 Bad Request
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., wrong request syntax).
- 401 Unauthorized
The request requires user authentication. The response must include a proper authentication.
- 403 Forbidden
The server understood the request, but refuses to authorize it. A 403 status code indicates that the server can be reached and understood the request, but refuses to take any further action.
- 404 Not Found
The server can't find the requested resource. This code is commonly used when the server doesn't want to reveal whether it has the resource or not.
- 500 Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request. This is a generic error message, given when no more specific message is suitable.
- 502 Bad Gateway
The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.
- 503 Service Unavailable
The server is currently unable to handle the request due to temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.
To make it easier to remember some of these codes, here’s a handy cheatsheet graphic: