In this article at OpenGenus, We are going to understand what HTTP response codes are along with the list and meaning of different HTTP Response Codes.
1. Introduction to HTTP Response Codes
Whenever you type in the URL and press the Enter button click, your browser then sends a request to the web server for the site you are trying to access. The server receives and processes the request, and then the server sends the relevant resources
with an HTTP header.
HTTP response codes get delivered to your browser in the HTTP header. While HTTP response codes get returned each time you make a request, you do not see them.
You might see one displayed in your browser if there is something wrong. That’s how the server tells you that there is something not right and here is a code that explains what happened.
2. Understanding HTTP Response Code Classes
HTTP response codes are divided into 5 “classes”. These are groupings of responses that have the same or related meanings.
These five classes include:
- 100s: The initial request was received by the server and the client should continue.
- 200s: The server successfully understood, received and processed the request and success codes get returned
- 300s: The server got the request, but a redirection to another location occurred.
- 400s: The server could not find (or access) the page or website.
- 500s: Server error code, indicating that the request was accepted, but there is an error on the server preventing the fulfillment of the request.
In each one of these classes, a diversity of server codes exist and the server may return them. Each response code has a unique meaning.
3. Guide and List of HTTP Response Codes
There are over forty different server response codes, However, you are probably going to encounter a small punch.Below is the more common ones.
100 Response Codes
A 100 response code indicates that the request you have sent to the server is still in progress for some kind of a reason. But this doesn’t imply it’s a problem.
- 100: “Continue” This response code means that the server got the request, and then you should continue.
- 101: “Switching protocols” you asked the server to change protocols and the server did.
- 103: “Early hints” Some response headers are sent before the server's response is ready.
200 Response Codes
This is the best type of HTTP response code to receive. A 200 response means that everything is working perfectly.
- 200: “Everything is OK” Is a good sign as it means successful HTTP requests.
- 201: “Created” A new resource has been created as a result of the server fulfilling the browser's request.
- 202: “Accepted” Your request was accepted by the server, but it is still being processed by the server, but the request at the end may or may not result in a completed response.
- 203: “Non-Authoritative Information” This response code may or may not appear when a proxy is in use. The proxy server received a 200 response code from the origin server, but modified the response before your browser received it.
- 204: “No Content” The server has completed the request successfully, but it will not return any content.
- 205: “Reset Content” Implies that the server has handled the request, however, there will be no content returned by the server. The document view must, However your browser has to reset the document view.
- 206: “Partial Content” The server is sending a fraction of the resource. When the client sends a Range header for a part of the resource only.
300 Response Codes
The process of letting people know that a resource has been moved to a new location is known as redirection. In order to tell visitors where to find the content they're looking for, redirections are accompanied by a number of HTTP response codes.
- 300: “Multiple Choices” There are various responses to the request. The user ought to select one of them.
- 301: “Moved Permanently” This demonstrates that the requested resource has been forever moved to another URL and the new URL is shown by the browser.
- 302: “Found” This indicates that the requested resource that was relocated had been discovered, just not in its intended location. It is utilized for temporary URL redirection.
- 303: “See Other” A GET request via the server redirects the client to the resource.
- 304: “Not Modified” Used for caching purposes. The client can continue to use the same cached version of the requested resource because the response has not been altered.
- 307: “Temporary Redirect” This response code has replaced 302 “Found” as the appropriate action when a resource has been temporarily moved to a different URL. Unlike the 302 response code, it does not allow the HTTP method to change.
400 Response Codes
At the 400 level, HTTP response codes start to become problematic. These are error codes stating that there’s something wrong with your browser and/or request.
- 400: “Bad Request” There is an error on the client’s side making the server not return a response.
- 401: “Unauthorized” The user doesn’t have authentication to get the requested resource.
- 402: “Payment Required” Reserved for use in the future; it was made for digital payment systems. But it’s very rarely used.
- 403: “Forbidden” This code is returned when a client attempts to get to something that they don't have permission to see. Attempting to access content that is password-protected without logging in, for instance, may result in a 403 error.
- 404: “Not Found” This code indicates that the server is unaware of the existence of the requested resource and that it does not exist. It is the most common one.
- 405: “Method Not Allowed” The target resource does not support the request method, but the server does.
- 408: “Request Timeout” The server timed out waiting, due to the client didn’t produce a request within the assigned time.
- 409: “Conflict” Due to a conflict with the resource, the server is unable to fulfill the request. It will show the client information about the issue so they can fix it and resubmit.
- 410: “Gone” Indicates that the requested content will not be reinstated because it has been permanently deleted from the server.
- 411: “Length Required” This demonstrates that the client didn't indicate a specific length for the requested resource.
- 412: “Precondition Failed” The preconditions made by the user were not fulfilled by the server.
- 413: “Payload Too Large” The server is unable to process your request because it is too large.
- 414: “URI Too Long” A GET request that has been encoded as a query string that is too large for the server to process typically causes this.
- 415: “Unsupported Media Type.” The media format is not supported by the server.
- 416: “Range Not Satisfiable” The value indicated in the request’s Range header field can’t be fulfilled by the server.
- 417: “Expectation Failed" The server can't meet the requirements demonstrated by the Expect request header field.
500 Response Codes
500-level response codes are also considered errors. However, they signify that the problem is on the server side. Which makes them hard to resolve.
- 500: “Server-side error” There was an unexpected error and the request cannot be completed.
- 501: “Not Implemented” The server can not fulfill the request.
- 502: “Bad Gateway” The server has received an invalid response.
- 503: “Service Unavailable” This often occurs when a server is down for maintenance or overloaded.
- 504: “Gateway Timeout” The server acting as the gateway was timed out, waiting for a response.
- 505: “HTTP Version is not Supported” The HTTP version is not supported.
- 508: “Loop Detected” While processing the request, the server finds an infinite loop.
- 509: “Bandwidth Limit Exceeded” Your website is using more bandwidth than what is allowed by your hosting provider.
With this article at OpenGenus, you Should have a strong idea about the types of HTTP Response Codes.