HTTP Status Code is returned when an HTTP request is made to the server. The server returns an HTTP Status Code in response to your request.
There are five classes of HTTP Status Code as follows.
- Informational – 1XX
- Success – 2XX
- Redirection – 3XX
- Client Error – 4XX
- Server Error – 5XX
Let’s take a look at the below diagram, which gives an idea of how a status code is returned from the web server.
So now, you know how the status code is generated, and here are some of the popular HTTP status return codes in Infographics.
200 – OK: The standard HTTP response for successful HTTP requests. In another way, the web server will return 200 when the requested content is served successfully.
202 – Accepted: The server has accepted your request and has yet to process them.
206 – Partial Content: Only partial content is delivered due to the range header sent by a client like wget.
301 – Moved permanently: Your requested page has been moved permanently to a new location. This instructs a search engine bot to crawl a new location.
302 – Moved temporarily: Your request is served from a different location, but that is a temporary arrangement. This instructs the search engine bot to crawl the original location.
305 – Use proxy: The requested resource is only available through a proxy. That means you must use a relevant proxy to get the requested page successfully.
304 – Not modified: Usually, when the cached page is served when a resource has not been modified.
400 – Bad request: The server is confused about what you have requested. Probably bad syntax or trying to include characters in URI, which the server doesn’t understand.
401 – Not authorized: The requested page is protected and requires authentication. You must log in in order to get the requested page successfully.
403 – Forbidden: You have to try to access to which you don’t have permission. This not necessary resource is protected by the password; it could also be when files/folder permission doesn’t allow viewing the requested page.
404 – Not found: Probably the most famous one – your requested page is not found on the server. You are trying to access something which doesn’t exist.
405 – Method not allowed: You are requesting a page with the wrong method. For example, you are doing GET on POST data. Or you are trying the method which is disabled, for example – TRACE, PUT, DELETE.
408 – Request timeout: The server timed out waiting for the request
411 – Length required: Your request doesn’t meet the length of its content, which is required by the requested resource.
500 – Internal server error: A very generic error when the server encountered an error due to various reasons. Logs must be examined to see why the server has responded to an internal error.
502 – Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server like Tomcat, WebSphere.
503 – Service unavailable: The server can’t serve your request. This could be due to either server being too busy with other stuff or almost dead.
I hope now you have an idea about the HTTP status return code. If you find this useful, help in sharing it with your friends.