HTTP Response Status Codes

A Complete Guide to HTTP Status Codes

22 January 2022

Home >> Technical SEO >> A Complete Guide to HTTP Status Codes

 

An HTTP status code is the server's response to the browser to address whether the particular request can be fulfilled. When a specific URL is clicked or typed in, the browser sends a request to the server of the website the user is trying to access. Once the server receives the request, it processes the same and sends back the asked resourced with an HTTP Header. In simple words, in a restaurant, when you are ordering food, the waiter responds as to whether a particular dish can be served or not. If the asked dish is available, the waiter processes and serves the dish on your table!

 

HTTP Response Codes

 

These status codes are not a part of a website's content but are only messages to tell the user about the responses received when asked to view a particular page. These are delivered to the browser in the HTTP header itself. HTTP header comprises the response of the status code along with additional information. The status code is not completely the header itself.

The status code should be set up before sending any output. These status codes are divided into the following five classes:
100s: Informational codes indicate that the initiated request is continuing.
200s: Success codes that are returned when the request is received and processed by the server.
300s: These are redirection codes that are returned when a new resource is substituted for the asked resource.
400s: Client error codes indicate a problem with the request asked.
500s: Server error codes indicate that the request was accepted but was not fulfilled due to an error on the server.


The aim of HTTP responses is to provide detailed information to the user about the progress of the request asked. The response contains a status line, header fields, and a message body.

The status line is the first line which consists of three things - the HTTP version number, status code, and a reason phrase. The HTTP headers contain information that can be used by a client to find further details about the response and the server which sent it. The information can be used for displaying responses, storing them for the future, and making requests to the server.

The message body, also known as the response body is used for almost all responses except the case where requests are asking only for response headers, or the server is using specific status codes. The message body contains the resource asked by the client or the status of the action. It also provides a response to an unsuccessful request or about a specific action to be made by the client for successful request completion.


Although the complete list of HTTP status codes is easily available, compiling a few of the important ones can be handy as and when required. These can be named HTTP Status code cheat sheets as well:

A. 200: The 200 status code is the most common returned code. It simply means that the request has been received and is being processed.

B. 201: This 201 (Created) HTTP status response code indicates the success of the request leading to resource creation. If an error 201 pops up, the easiest way to solve it is to reset the date and time settings.

C. 202: The server is still processing the request of your browser after accepting it. In this case, you may or may not receive a completed response to the request.

D. 203: The response (200 OK) from the origin server gets modified by the proxy server and then it gets passed to your browser.

E. 204: This 204 response code indicates the success of the request but the user cannot navigate to the next page. This status code is usually used for filling long forms where work needs to be saved at regular intervals.

F. 301: Indicates the permanent replacement of the requested resource with a different resource.

G. 302: The HTTP status code 302 (temporary) means an action of performing URL redirection. The redirected URL is an identical but additional new URL gets highlighted in the location field. The redirection takes place from the old to the new URL.

H. 307: This status code does not allow the HTTP method to change and it occurs whenever a resource is temporarily moved to a different URL.

I. 400: The HTTP Status Code 400 means a bad request response status code due to the user error because of which the server cannot process the request.

J. 401: The 401 status code indicates the inapplicability of HTTP since it lacks valid authentication credentials for the target resource. The credentials are usually username and password.

K. 403: The HTTP status code 403 is a Forbidden response status code which indicates that though the server has understood the request, it refuses to authorize it. Re-authenticating will make no difference instead, make sure that the URL is correct, or you will need to contact the internet service provider.

L. 404: This is the most common status code of all and it means that the "the requested resource was not found".

M. 429: This is observed when there are too many requests sent by the user in a given amount of time.

N. 500: The HTTP status code 500 is shown up when no other error code is applicable. It is a generic error response which means that the server has experienced an unexpected situation that has prevented it from fulfilling the request.

O. 502: This status code is termed as "Bad Gateway" and it occurs due to the invalid response received by one server from another.

P. 503: The HTTP status code 503 is Service Unavailable server error. This 503 response code indicates that the server cannot handle the request at that point in time. It can be due to a maintenance issue of the server or the server is overloaded.
The most common cause of the 503 error is the communication breakdown between the website and the server due to which the website cannot handle any requests.

Q. 504: The gateway timeout error occurs when the server acting as a gateway or proxy does not receive a timely response from another server upstream.


The main difference between 4xx and 5xx is about the blame game, that is, whose fault that particular error is. A 4xx code depicts that an error has been made by the user whereas a 5xx code informs the user that an error is part of the server itself and they have done everything correctly.


FAQ

Here are some frequently asked questions about HTTP Status Codes:


1. Why do we need status code?

HTTP status codes are crucial whenever you execute search engine optimization (SEO) on your website. These codes help you to provide information about problems with the requested content.


2. What are some of the most common HTTP Status Codes that everyone should know?

The most common status codes are 401, 403, 404, 500, 503, 302, 204, 201, and 200. All the codes are explained here in this article.


3. What is HTTP and its methods?

HTTP, a hypertext transfer protocol is designed for encoding and transporting information between a server and a client (such as web browser). There are several HTTP methods and the two most common ones are GET, POST.


4. Is HTTP Status Code a header?

It is a part of the full HTTP response (a server sends to a client) which contains additional information as well. It is not possible to know what the full HTTP header response of a URL can contain because of the extensible nature of HTTP headers.

Technical SEO Blogs

301 Redirects for SEO Experts

301 Redirects for SEO Experts

9 May 2019 |

Technical SEO

Know the importance of 301 Redirects in an SEO strategy.

Indexability Factors for SEO

Indexability Factors for SEO

30 December 2020 |

Technical SEO

Here a few factors for your web pages to get indexed.

Website Indexing in SEO

Website Indexing in SEO

27 May 2019 |

Technical SEO

In-depth information about crawling and indexing for SEO Experts.

WordPress SEO Plugins

WordPress SEO Plugins

6 May 2019 |

Technical SEO

The list of best WordPress SEO Plugins for Experts.

Digital Marketing Boy