A cheat sheet of common HTTP Status Codes along with their definitions

HTTP status codes, often referred to as “HTTP response status codes” or simply “HTTP status codes,” are three-digit numeric codes that are returned by web servers to provide information about the outcome of an HTTP request made by a client (such as a web browser or a program accessing a web service). These status codes are an essential part of the HTTP protocol and are used to communicate various aspects of the response to both the client and any intermediaries, like proxies or caching servers. Each status code has a specific meaning and helps diagnose and troubleshoot issues related to web requests and responses.

Here’s a cheat sheet of common HTTP status codes along with their definitions:

1xx – Informational Responses: These status codes indicate that the server has received the client’s request and is continuing to process it. These responses are usually informational and rarely seen in practice.

  • 100 Continue: The server has received the request headers, and the client should proceed to send the request body.
  • 101 Switching Protocols: The server is switching to a different protocol per the client’s request, e.g., from HTTP to WebSocket.

2xx – Successful Responses: These status codes indicate that the request was received, understood, and successfully processed by the server. The client’s request was valid, and the server was able to fulfill it.

  • 200 OK: The request was successful, and the server has returned the requested data.
  • 201 Created: The request has been successfully fulfilled, resulting in the creation of a new resource.
  • 204 No Content: The request was successful, but there is no response body to return (often used in AJAX requests).

3xx – Redirection: These status codes indicate that further action is needed to complete the request. They typically involve redirecting the client to a different URL or location.

  • 301 Moved Permanently: The requested resource has moved permanently to a new URL. Browsers and search engines should update their links.
  • 302 Found (or 303 See Other): The requested resource has temporarily moved to a different URL. Often used for temporary redirects.
  • 304 Not Modified: The client’s cached copy of the resource is still valid, and there’s no need to re-download it.

4xx – Client Errors: These status codes indicate that there was an issue with the client’s request. It could be due to malformed syntax, authentication problems, or insufficient permissions.

  • 400 Bad Request: The server could not understand the request due to a malformed syntax or invalid parameters.
  • 401 Unauthorized: Authentication is required, and the client must provide valid credentials.
  • 403 Forbidden: The server understood the request but refuses to fulfill it due to permissions or access restrictions.
  • 404 Not Found: The requested resource could not be found on the server.

5xx – Server Errors: These status codes indicate that the server encountered an error or was unable to fulfill the request due to server-side issues. It’s generally not a problem with the client’s request.

  • 500 Internal Server Error: A generic server error occurred, indicating that the server encountered an unexpected condition.
  • 501 Not Implemented: The server does not support the functionality required to fulfill the request.
  • 502 Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from an upstream server.
  • 503 Service Unavailable: The server is currently unable to handle the request due to temporary overloading or maintenance.

Other Notable Status Codes:

  • 418 I’m a teapot: A humorous status code that indicates the server is a teapot, not capable of making coffee. Not used in serious applications.
  • 451 Unavailable For Legal Reasons: Indicates that the server is refusing to provide service due to legal restrictions, such as censorship or copyright issues.

Here are a few examples of commonly encountered HTTP status codes and their meanings, picked from the above list:

  • 200 OK: The request was successful, and the server has returned the requested data. This is the standard response for successful HTTP requests.
  • 301 Moved Permanently: The requested resource has moved permanently to a new URL. Browsers and search engines should update their links.
  • 404 Not Found: The requested resource could not be found on the server. This is a common error for non-existent URLs.
  • 403 Forbidden: The server understood the request but refuses to fulfill it due to permissions or access restrictions.
  • 500 Internal Server Error: A generic server error occurred, indicating that the server encountered an unexpected condition.
  • 502 Bad Gateway: The server, acting as a gateway or proxy, received an invalid response from an upstream server.

HTTP status codes are important for both developers and users. They help developers diagnose and fix issues with web applications, and they inform users about the success or failure of their requests. Understanding HTTP status codes is crucial for troubleshooting and improving the performance and reliability of web services and websites.

Suresh Chowhan
Suresh Chowhan

Suresh is from Delhi, India and the founder of YoGrade.com and YoMetro.com. He is into the field of SEO and digital marketing since 2005. He helped to shine in organic search to the big brands like MakeMyTrip, MonsterIndia, TimesofIndia, ikman, Bikroy & more.

Articles: 65

Leave a Reply

Your email address will not be published. Required fields are marked *