HTTP Status codes
Just kidding...
Have you ever come across this message when you try to access a certain web page? Ever wondered what 404 stands for?
In this mini blog we are going to look at some widely used status codes in HTTP.
Types of HTTP Status codes
- 1xx : Informational Status code. These codes keeps the client informed of basic headers.
- 2xx: These codes reflect a successful response or operation
- 3xx: Redirection codes
- 4xx: Client Error codes (404)
- 5xx: Server Error codes
Now, we'll look at some commonly used status codes.
2xx
200 - OK
- Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource.
201 - Creat
- This status code is sent as a response when the request was a POST method. If the POST request was successfully sent and processed, we get a 201 status code.
204 - No Content
- The request was successful but there's nothing to respond with. Hence, this status code will be returned. This status code was widely used in the early days of HTTP implementation and losing its fame recently.
3xx
301 - Moved Permanently
- This status codes indicates that all resources are moved to a different location and all current and future request requests will be redirected to that new location
302 - Moved Temporarily (also known as Found)
- The requested resource was found but has been moved temporarily to another location.
4xx
400 - Bad request
- The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing)
401 - Unauthorized (Same as 403)
- This status code is used when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
404 - Not Found!
- The requested resource cannot be found on the URL/URI. There are also substatus codes defined by Microsoft Internet Servers. See it here.
408 - Request timed-out
- The server timed out waiting for the request. That is the client did not send any request during the given period to make requests
409 - Conflict
- Indicates that the request could not be processed because of conflict in the current state of the resource, such as an edit conflict between multiple simultaneous updates.
5xx
500 - Internal Server Error
- This status code is sent when an unexpected or unknown error occurred in the server while making a request.
502 - Bad Gateway
- The server was acting as a gateway or proxy and received an invalid response from the upstream server.
530 - Site is frozen (Unofficial Code)
To view all HTTP status codes and related details, please click here!
That's all for this post.
Your suggestions on new posts and comments are welome
Manoj Kumar D


Comments
Post a Comment