What is HTTP status codes? How it helps to identify the problem in HTTP request. In this tutorial, we are going to walk through HTTP status codes & their significance.
What is HTTP status codes?
HTTP status codes are the response code of a HTTP request which tells whether the request is successfully completed or not.
For example, Suppose you have typed the URL in your browser and hit enter. This HTTP request goes to a server. If the web page does not exist it returns 404 page not found. So, 404 is a standard HTTP status code which tells the web page you are looking for does not exist.
HTTP Status Code Response Classes
HTTP status code response is grouped into five classes.
1xx – Informational responses
2xx – Successful responses
3xx – Redirection messages
4xx – Client Error responses
5xx – Server error responses
Popular HTTP Status Codes
200 – Request is successful
404 – Page not found
503 – Server is temporarily not available
HTTP 200’s Status Code
1. 200 -successful
This status code represents that the server has delivered the request successfully.
2. 206 Partial Content
When the server has fulfilled the partial GET request.
HTTP 3xx Status Codes – Redirection
HTTP 301 status code – Permanent Redirection
This status code signifies that the resource you are looking for permanently redirected to a new URL.
HTTP 302 status code – Found
It means the requested resource has moved temporarily to a new URL.
HTTP 304 status code – Not Modified
This status code is mainly used for caching purposes. This status code tells the client that the response is not modified, so you can use cached response.
It is the response code to an If-Modified-Since or If-None-Match header, where the URL has not been modified since the specified date.
HTTP 4xx Status Code – Problem with the request (Client error)
HTTP 400 status code – Bad request
HTTP 400 status code represent that server did not understand request completely due to syntax problem or bad syntax.
HTTP 401 status code – Unauthorized
As the name unauthorized represent that it requires user authentication. To access any resource client need to be authorized by the server.
HTTP 403 status code – Forbidden
In this case, the client doest not have access to get requested response of a resource.
HTTP 404 status code – Not Found
It is one of most common and popular status code. It tells the resource you are looking for doesn’t exist.
HTTP Status Code 5xx – Server Error
5xx HTTP status code is returned when a client sends a valid request but server failed to fulfill the request.
HTTP 500 status code – Internal Server Error
HTTP 500 status code signifies that the server has encountered a situation it doesn’t know how to handle.
HTTP 503 status code – Service Unavailable
HTTP 503 status code is returned when a server is down or busy to fulfill other requests due to which it unable to handle the current request.
HTTP 504 status code – Gateway Timeout
In this case, one server does not receive the timely response of another server.
For more information, you can check Wikipedia.