Essential HTTP Status Codes for Search Engine & Search Engine Optimization

June

10

0 comments

A status code is a three-digit HTTP response code that indicates the result of an HTTP request.

Status codes are issued by a server in response to a client’s request to access a resource. The first digit of the status code specifies one of five classes of response:

The way should be clear from this table that many different classifications exist for status codes, and these classifications address issues ranging from simple success or failure of a request to Redirection for further action to be taken.

HTTP Header Response

Status Codes are a significant part of the HTTP Header Response, and should not be underestimated. Not only can they help you debug issues with your own website or application, understanding how to leverage them in a browser will also assist you when using other services over the internet. If you were ever wondering why you have to keep pressing F5 in your browser, this is probably why. For example, the http://code.google.com link (and many others) opens up a new window rather than refreshing the current page because of its use of Refresh (status code 302).

Status Codes are entirely separate from HTML, CSS, and JavaScript; they serve as a layer on top of that and can be used to convey even more information about the state of an HTTP connection.

Status Codes are not typically displayed to users directly – they tell you what happened behind the scenes as a result of your request to access a resource.

GET, POST, PUT, DELETE

HTTP status codes vary with every single different method (GET, POST, PUT, DELETE) that is used in an HTTP protocol. There are hundreds of different status codes available to use, but only a handful are typically used on a regular basis.

1xx InformationalThese request the server to send back some information about its current state or the requested action.
2xx SuccessThis class of status codes indicates that the client’s request was successfully received, understood, and accepted.
3xx RedirectionThis class of status code is sent to the client if the server finds that it needs some additional action on its part before it can fulfill the request.
4xx Client ErrorThe 4xx class of status code is for when the problem is on the client’s end.
5xx Server ErrorThe 5xx class of status code is for when something went wrong on the server’s side.

OPTIONS message

In some cases, a receiving user agent will need to respond with a capability message in order to provide information about its abilities and about the current state of the connection. In other cases, a receiving user agent will need to respond with an OPTIONS message, confirming which methods are supported. Other kinds of messages can be sent as well; for example, if the client sent an invalid request (say, asking for forward-slash), it would get back a response indicating what went wrong (in this case, “/” is not a valid page).

The following table lists the HTTP response codes:

HTTP Status CodesResponse
1xx Informationalthese request the server to send back some information about its current state or the requested action.
100 ContinueThe client can send this message to indicate that it is ready to receive the entity enclosed in the message after this one.
2xx SuccessThis class of status codes indicates that the client’s request was successfully received, understood, and accepted.
200 OKThe request has succeeded. The information returned with the response is dependent on the method used in the request, for example: GET an entity corresponding to the requested resource is sent in the response; HEAD the entity-headers of the corresponding 200 response; POST an entity describing or containing the result of the action.
3xx RedirectionThis class of status code is sent to the client if the server finds that it needs some additional action on its part before it can fulfill the request.
302 FoundInstructs user agents that this resource resides temporarily under a different URI.
4xx Client ErrorThe 4xx class of status code is for when the problem is on the client’s end.
400 Bad RequestThis response suggests that the server cannot process the request due to bad syntax, invalid requests, or any other reason.
401 UnauthorizedThis response code and a WWW-Authenticate header are sent when a client tries to access a page that is only meant for one user and the user has not been authorized.
403 ForbiddenThis response code means that the server understood the request, but refuses to authorize it or any other methods on the requested resource.
404 Not FoundThe requested resource could not be found but may be available again in the future. An example of this would be a link to a page or file that no longer exists.
405 Method Not AllowedThe requested resource doesn’t support the methods used in your request. For example, you might have tried to post data when only GET was intended for the resource.
406 Not Acceptable This response code means that the requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
5xx Server ErrorThe 5xx class of status code is for when something went wrong on the server’s side.
500 Internal Server ErrorThis indicates that the server has an unexpected condition to report.
501 Not ImplementedThe requested method is not supported by the server and cannot be made available to the client.
502 Bad GatewayThis response tells the client that another server is acting as a gateway to the requested resource, while the client should continue its requests on this other server.
503 Service UnavailableThis response code means that the server is currently unable to handle the request due to temporary overloading or maintenance of the machine, which will likely be alleviated after some delay.

The following table lists examples for HTTP status codes:

Examples HTTP Status CodesHTTP status code
Request sent by client: Request-Line = “GET” “/” HTTP/1.1HTTP/1.0 200 OK
Request sent by client: Request-Line = “POST” “/login/” HTTP/1.1HTTP/1.0 302 Found
Request sent by client: Request-Line = “GET” “/upload/” HTTP/1.0HTTP/0.9 400 Bad Request
Request sent by client: Request-Line = “POST” “/upload/” Content-Type: “application/json” Content-Length: 13 {“name”:”Rashid”}HTTP/1.0 405 Method Not Allowed

Server response with code 200 OK will be returned if the content type of the POST request is not JSON.

About the author, Team Digital Shiksha

Digital Shiksha is the leading online and interactive digital marketing training institute in India. We offer professional certification courses in Digital Marketing, which will help you create effective digital marketing strategies. Our students have access to the latest tools and techniques used in online marketing, including social networking, mobile marketing, online communities, viral marketing, wikis, and blogs. With a career in online, interactive, and digital marketing, you can progress into roles such as campaign planning and brand development. At Digital Shiksha we are committed to supporting and educating our students to reach their full potential in the field of digital marketing.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Learn more about [your subject]. Start Now!

E-book 01
E-book 02
>