Writing / Networking & the web · · 2 min read
HTTP status codes

HTTP status codes specifies whether the request that you send to the server or on the browser is successful or there is any error or any redirection taking place.
For creating an api, the developer should have knowledge about these http status codes and also in general, one should be aware of the most important status codes that we encounter in our daily developer life.
Basically, these codes are divided into 5 classes:
-
100–199 : Informational responses
-
200–299 : Successful responses
-
300–399 : Redirect responses
-
400–499 : Client errors
-
500–599 : Server errors
As a developer, one should be knowing about the second, third, fourth and fifth classes codes.

SUCCESSFUL RESPONSES (200–299)
-
200 : This is one of the most used and useful code. This tells us whether the request have been successful or not.
-
201 : This signifies that the request have been succeeded and a new resource have been created.
-
204 : This signifies that no content have to be sent back if the request is succeeded.
REDIRECT RESPONSES (300–399)
-
301, 308 : This specifies that the url you are looking for have been moved to somewhere else permanently or a permanent redirect.
-
302, 307 : This specifies that the url you are looking for have been moved to somewhere else temporarily or a temporary redirect.
CLIENT ERRORS (400–499)
-
400 : Bad request or the server is not able to understand the syntax of the request.
-
401 : Unauthorized. The user which is trying to access certain page or resource is not logged in.
-
**403 : **The user which is trying to access certain page or resource does not have required permissions and is forbidden.
-
404 : The page or the content which a user is trying to access is not found on the server.
-
405 : The method through which a user is trying to make the http request is not allowed. e.g not allowing PUT request on a url.
-
408 : The request gets timed out.
-
415 : Unsupported media types.
-
429 : The rate of request exceeds the limit i.e too many requests at a time.
SERVER ERRORS (500–599)
-
500 : Internal server error. The server is not able to handle the request.
-
502 : Bad Gateway.
-
503 : Service unavailable.
-
507 : Insufficient storage.
These all are some of the important http status codes. There are many other codes also but those are not that important but if you want to read about every status code, do have a look here:
HTTP response status codes - HTTP | MDN
If you like the blog, hit that clap icon and if you want to read more such blogs on essential things you need to know as a developer, follow me up.
Written by Dikshant Rajput, AI and full-stack engineer. Also published on Medium. Questions? Ask my AI version or get in touch.