HTTP Response Status Codes

Updated on

When Web browsers and search engine bots request Web pages, the servers send back responses that contain status codes.

The first version of the HTTP protocol (0.9) didn’t have error messages. When a browser requested a Web page, there was no standard, machine-readable way for the browser to know if the request was successful or not — just a human-readable message:

Error responses are supplied in human readable text in HTML syntax. There is no way to distinguish an error response from a satisfactory response except for the content of the text.

To deal with that problem, later versions of HTTP added status codes to the responses.

An HTTP status code is a simple 3-digit number that tells Web browsers (and other clients like search engine bots) what happened when the page was requested. Some common status codes with their meanings are:

The codes have categories:

Example

The Request-Line in an HTTP request might look like this, saying GET me the /about page using version 2 of the HTTP protocol:

GET /about HTTP/2

and the server would send back a Status-Line like this:

HTTP/2 200 OK

which means, I’m replying with version 2 of HTTP and everything went okay with your request (200).

Takeaways

Things you should remember from this section:

Return to the main tutorial page.

Feedback and Comments

What did you think about this page? Do you have any questions, or is there anything that could be improved? You can leave a comment after clicking on an icon below.