Have you ever thought of what happens after making a query on a browser? Well, it is pretty complex. The connection between the browser, respective computer, and servers spread all over the world in space and time is a long chain. This complexity includes more stakeholders such as data centers, content data networks (CDN) and systems administrators.
Despite this seemingly carefully choreographed strategy, it is not uncommon to run into errors. For example, you can get Soft 401 Not Found Errors or Unknown 501 errors that are very annoying.
While the visitor is annoyed, the webmaster or site owner feels like getting mad because visitors are unable to access the site, various concepts are not working, and entire business grinds to a halt. Therefore, it is very critical to know these HTTP status codes to take the right action when they happen.
Table of Contents
What are HTTPS requests and responses?
HTTP is an abbreviation that denotes HyperText Transfer Protocol. In a simpler language, HTTP is the rules and procedures of how web browsers request for a resource from one computer to another and the manner of the request.
Status Code Classes: The status codes are denoted in three digits with the first digit being between one and five. The status codes are categorized into five main classes with every class indicating the specific range of states/issues.
HTTP Status Code 1xx (Informational code)
The 100 status codes are meant to be provisional. They are sent by a server before a complete 2nd response is given.
- HTTP 100 (continue): Means you continue with the request when the response or pages you asked for are broken down. The server might send 417 expectations failed of the request fails further.
- HTTP 101 (Switching Protocols): When a client asks a server to switch protocols such as HTTP 2.0 to HTTP 1.0, the server will send the response 101 if it is willing to implement the protocol.
- HTTP 102 (Processing): This code lets the client understand that a request has been received and is being processed. It is only applied in WebDAV.
HTTP Status Code 2xx — Success
Most of the second level status codes are rarely used.
- HTTP 200 (OK): This is the standard response indicating request was successful.
- HTTP 201 (created): This is when requests are targeted at creating new resources. The code 201 is sent to indicate that the request was successful.
- HTTP 204 (no content): This response code is sent when the server completes processing a request, but there is no content to display.
Other second level HTTPS codes include the HTTP 205 (reset content), HTTP 206 (partial content), HTTP 207 (multi status), and HTTP 226 (IM used).
HTTP Status Code 3xx — Redirection
The statuses in the third level are sent to users when an additional action is required for a specific request to get completed. This is commonly utilized when redirecting one URL to another. In the event of GET requests, many browsers implement the second part of the request without waiting for input from the user.
- HTTP 300 (multiple choices): The 30 status is usually returned by browsers when several options for a specific request are available.
- HTTP 301 (moved permanently): This HTTP status code indicates that a resource has changed the URL permanently. If you have moved a page to a different location, it is important to implement 301 redirects or use .htaccess to take visitors to the file they want.
- HTTP 308 (Permanent Redirect): This status duplicates the specific functionalities that are given in HTTP 302. This request should be repeated with another URL and all later requests directed to the new URL.
Other third level status codes include HTTP 303 (see other), HTTP 304 (not modified), and HTTP 306 (switch proxy).
HTTP Status Code 4xx (Client Error)
These codes are used to point when clients make errors. They are targeted to appear like coming from clients. This indicates that something is wrong with the request that a client has made.
- HTTP 400 (request): This generic response indicates that the request is malformed in the syntax or formatting. Servers provide more info on what went wrong.
- HTTP 401 (unauthorized): This status code points that one is restricted from using a specific resource. For example, when authentication fails.
- HTTP 402 (payment required): Though not commonly used, it means that additional information including payment authentication is required.
- HTTP 403 (forbidden): Just like 401, this code means that the request was okay, but the server failed to respond because the request failed to get permission.
Other fourth level HTTP status codes include the HTTP 404 (not found), HTTP 405 (Method Not Allowed), HTTP 422 (Unprocessable Entity), HTTP 406 (Not Acceptable), HTTP 407 (Proxy Authentication Required), HTTP 408 (Request Timeout), and HTTP 451 (Unavailable For Legal Reasons (Draft)).
HTTP Status Code 5xx (Server Error)
The fifth level errors are issued to the user when something happens with the server. These responses provide ample details on the problem so that the user can take the right action.
- HTTP 500 (Internal Server Error): This indicates that something indeterminate such as server configuration went wrong.
- HTTP 501 (not implemented): This status code is returned when the specific action like put or delete is yet to be implemented.
- HTTP 502 (Bad Gateway): This happens when a server acts a proxy and gets an invalid response from another upstream server.
Other level five status codes include HTTP 503 (Service Unavailable), HTTP 504 (Gateway Timeout), HTTP 506 (Variant Also Negotiates), HTTP 508 (Loop Detected), HTTP 510 (Not Extended), and HTTP 520 (Unknown Error).