HTTP Status Codes: Types and Common Code Explanations

Kyle Farmer
CodeX
Published in
5 min readAug 20, 2021

You’ve been receiving HTTP status codes (whether you know it or not) for as long as you’ve been using a web browser. They are sent back to you anytime you make an HTTP request. So basically anytime you make a request to visit any URL, click a link in your browser, or request data from an API, you will receive a code back from a server. You may not always be aware of the code — you usually will not even see the status code unless you know where to look!

How to View Status Codes

You can view the HTTP status codes by opening the network section of the browser’s developer tools.

the Network tab of Chrome’s Dev Tools

Chrome: Mac command + option+ i Windowscontrol + shift + j

Firefox: Mac command + option + e Windows control + shift + e

Safari: Mac command + option + e

Types of HTTP Status Codes

HTTP status codes are 3 digit responses that a server sends to your browser when an HTTP request is made. There are 5 types of status codes. The first status code of each category starts at 100, 200, 300, 400, and 500. For example, all 400 category codes are known as “client errors”. So status codes of 401, 403, and the common 404 codes all fall into the “client errors” category. And don’t worry, you don’t have to memorize a hundred codes for each category! There a just a handful (63) of standard codes that you are likely to see. Let’s take a closer look at the categories:

100 — Informational responses: The HTTP request was received, but the process has not been completed and is still working/in progress. These codes are temporarily given until the process finishes, which will then cause a different code to be sent to the browser.

200 — Successful responses: The HTTP request was successful and the client-side browser has received the expected data back from the server. These are the codes you should expect/want to see to ensure the requests are being fulfilled properly.

300 — Redirection: Your browser has been redirected, additional action must be taken to complete the request. This means the resource you requested has most likely been moved, but you will be taken to the new location. Once the redirection has been completed you should receive a 200 status code.

400 — Client errors: There is a problem with the HTTP request, and it was not completed. Either there is a syntax error in your request or the page you are attempting to reach is unavailable (page can’t be found or doesn’t exist), and the request cannot be fulfilled.

500 — Server errors: The HTTP request is valid, however, an error occurred on the server-side and it has prevented the request from being fulfilled. (There isn’t much you can do about this error unless you have control of the server!)

Common Status Codes

200: OK — The most common, standard code telling you everything went, well, “OK”. The request was fulfilled by the server and the response was properly returned to the browser. Most commonly received after a standard GET request.

201: Created — The request was fulfilled and a new resource was created as a result. Most commonly received after a POST or PUT request.

204: No Content — The request was properly fulfilled but no data was returned to the browser. Most commonly received after a DELETE request.

301: Moved Permanently — The URL you are visiting permanently redirects you to a different resource. The redirect will also pass along some important information to the search engines even though the URL is at a different location.

302: Found — The URL you are visiting will temporarily redirect you to a different resource. It means a change will be made soon though, and therefore will not pass along helpful info to search engines.

400: Bad Request — There is invalid syntax in the request that could not be understood by the server.

401: Unauthorized — The server requires authentication but it has not been provided by the request. An example would be trying to consume data from an API but leaving out the required unique key.

403: Forbidden — A valid request was received by the server but the client/user does not have the right permissions, account, or rights to access the data.

404: Not Found — The most common of the errors! The request is valid, but the server cannot find the resource that is being requested.

410: Gone — The request was sent to a dead resource. It is no longer available and it isn’t coming back.

418: I’m a teapot — This is a joke. But it is real. Although not used in any practical or useful ways, some sites do return this code in an attempt to be funny. It is ignored by most browsers as it is not an official status code.

451: Unavailable for Legal Reasons — The server is prohibiting access due to legal reasons. Could be due to copyright violation, government censorship, or a court order. Yes, this is a reference to the novel Fahrenheit 451 by Ray Bradbury.

500: Internal Server Error — The classic server error. There isn’t a problem with the request, but rather the server. It is a vague status and doesn’t give much more information about what the problem is other than the problem is unexpected.

502: Bad Gateway — This means the server that received the request is functioning as a gateway or proxy for another server upstream, and the upstream server sent an invalid response back.

503: Service Unavailable — Usually a temporary status that indicates the server may be overloaded, down for maintenance, etc. Whatever the reason, it’s unable to handle requests at the moment.

504: Gateway Timeout — Similar to the 502 error, the server acting as a gateway is unable to get a response from the upstream server in a timely manner.

https://www.dotcom-monitor.com/blog/2019/10/03/the-10-most-common-http-status-codes/

https://umbraco.com/knowledge-base/http-status-codes/

--

--