Ad Code

Complete List of HTTP Status Code: Meaning and Causes

Table of Contents [Show]

    Complete List of HTTP Status Code: Meaning and Causes


    The HTTP Status Code is a small code or note attached to the HTTP response that determines whether the request made by the client has been successfully completed or not. The code is provided in response to a client's request to the server.

    In short, when a client makes a request, the HTTP status code sent by the server lets the client know whether the request was successful, failed, or something in between.

    Look at the illustration below:


    When the browser sends a request to the server, the server responds back with a three-digit HTTP status code.

    Types of HTTP Status Code


    The status code is divided into five classes. The first digit of the HTTP status code defines the class of the five groups while the last two digits are unique identification digits.

    IANA (Internet Assigned Numbers Authority) is the official organization set up to regulate the registry of the HTTP status code.

    The following are the five classes defined by the IANA standards:

    • 1xx - Information
    • 2xx - Success
    • 3xx - Redirect
    • 4xx - Client error
    • 5xx - Server error

    Block 100 is a request for information, block 200 is a successful request, block 300 is a redirect, block 400 is a client error, and block 500 is a server error code.

    Code 1xx


    Codes starting with the number 1 will provide some information while the connection is still ongoing. This status code class defines that the request has been received and processing has started.

    An informed response is issued to inform the client that processing of the request has begun, only awaiting a final response. The response consists of only the status line and optional header fields ended by a blank line.

    100 Continue


    100 Continue is an informational status response code indicating that until now everything was fine, and the client should continue sending the body of the request. If the request is complete, then this status code can be ignored.

    The client should send Expect: 100- continue as a header in the initial request so that the server can check the request headers, the client will receive a 100-continue HTTP status code in response before sending the request body.

    100 Switching Protocols


    In this status code, the client has asked the server to change protocol. The server sends the 100 switching protocol as a response code to notify the client that it has switched to the protocol as requested by the client, by sending a message that includes an upgrade request header. In short, the server responds to the update request headers.

    102 Processing


    A 102 processing status code is sent by the server to inform the client that the server has received a complete request and is processing the request, however, no response is available.

    Code 2xx


    Class 2xx means that requests made by the client are received, understood, and accepted. In simpler terms, the 2xx status code indicates that the HTTP request was successful.

    200 OK


    The server sends back a 200 OK status code in response to a request made by the client indicating that the request was received and succeeded. The actual response with a 200 OK depends on the HTTP request method.

    201 created


    When the server sends the status code 201, it means that the request made by the client to the server to create a new resource has been successfully executed. The server returns information regarding the location of the newly created resource in the header field.

    In short, the 201 Created response is used to provide the URI in the header field for the location of the newly created resource.

    202 Accepted


    The server sends a 202 accepted in response to let the client know that the server has received the request and will do processing of the request later. This response is used when there is heavy computational processing required or a request needs to be processed in the near future. 

    For example, a client sends a request to a server for NEFT where NEFT is used to transfer money from one account to another at another bank. NEFT requests are processed three times a day, one in the morning, the second in the afternoon, and the third in the evening. 

    In such cases, a 202 accepted code will be sent to indicate that the request to transfer money is accepted, but will be made at a later date.

    203 Non-Authoritative Information


    The server uses a 203 Non-Authoritative Information response code, which lets the client know that the proxy server is between the client and the server. The proxy can change the header information or not.

    204 No Content


    204 No Content is used when the client's request is successful, but the server has nothing to send to the response body. On the HTTP request with the server response is code 204, the message content is empty or there is no content that can be shared.

    205 Reset Contents


    Sometimes the client also gets an HTTP 205 Reset Content response, and this response is used if the server wants the client's viewport to be reset.

    For example, the client creates a form to create a category and submits it, and then the server sends back a 205 response. This response means that the client needs to reset the input category to empty or reset the input category to the previously used category name.

    206 Partial Content


    The 206 Partial Content status code means that the server has partially fulfilled the GET request, but is not complete. Clients can use a range header field that indicates the desired range, so they can navigate to the larger response. Clients can also include an If-Range header field to make conditional requests.

    207 Multi-State


    207 Multi-Status is a new addition in the response code. For example, the client sends a request to the server, and then the server prepares a response. In order to prepare the response, the server needs to connect with three different machines, namely database system, file system and cache system.

    Suppose the database system is down, and sends code 500; in such a case, the server cannot tell whether the request was successful or not, so it sends back a 207 response. The multi-state code is included in the response body as text/xml or application/xml.

    208 Already Reported


    208 is similar to 207, but is only used for WebDAV. WebDAV stands for Web Distributed Authoring and Versioning. WebDAV is an extension of Hypertext Transfer Protocol (HTTP) that allows clients to perform remote web content creation operations on a distributed network.

    Code 3xx


    The 3xx block is a class used for redirection. URL redirection or forwarding is the process of providing more than one URL to a page. This status code that begins with the number 3 indicates that the client needs to take some additional action to complete the request.

    The process of redirection or redirection can be divided into three categories:

    • Permanent redirect: Permanent redirects are redirects where the new URL replaces the existing URL. This means that the original URL no longer exists and is replaced with a new one.
    • Temporary diversion: A temporary redirect means that the requested resource has assigned a new uri temporarily defined in the location header.
    • Custom redirects: Special redirects are address redirects that apply under certain conditions

    300 Multiple choices


    When the server sends 300 multiple choice, the HTTP response indicates that the request has multiple responses. Browser can choose one of them. There is no standard way to choose between these responses.

    301 Moved permanently


    The HTTP status code 301 tells the browser that the resource uri has been permanently changed to the new uri specified in the 'Location' response header. If we make a new request in the browser, then the browser will not make another request to the original link.

    302 Found


    Code 302 Found tells the browser that the resource uri has been temporarily changed. When the client makes a request, the browser redirects it to the new location only. The next time when the request comes, then the browser will call the original uri.

    303 See other


    The server sends a 303 response code to the client to get the requested resource in another uri with a GET request, which is why this code name is see other.

    HTTP response code 303 informs the browser to redirect to another page but not to the newly uploaded resource. Responses are sent only when the client has made a PUT or POST request. The method that displays the requested page is the GET method.

    304 Not Modified


    The server generates a 304 Not Modified response only when the file has not been modified since it was last accessed. This response essentially increases the speed of the user's browsing experience.

    If the page the user is accessing is not modified, then the client displays locally stored cached data to the user, so that the client does not make a request to the web server for the file. A 304 response is sent in response to a conditional validation request from the client to indicate that a copy of the client is available in cache.

    When a client makes a conditional validation request, it sends the last modified date of the copy with the help of the If-Modified-Since header and the cached ETag identifier with the help of the If-None-match identifier.

    The server checks this header to find whether the latest file is available in cache or not. If it's the latest, then the server sends back an HTTP 304 response.

    In this case, the client can use the file from the cache instead of sending a request to the server for the file. If the server finds obsolete files in cache, it sends back a 200 OK response and a new response body.

    307 Temporary Redirects


    Code 307 is similar to 302 in that both responses tell the client to temporarily redirect to a different resource that was requested. The only difference between 307 and 302 is that in 307, the client has to use the same request again. For example, if a client issues a POST request as the original request, then it must follow the same POST request in subsequent requests.

    308 Permanent Redirects


    Status code 308 came into the HTTP standard in April 2015, as stated in the specification document RFC7538. Code 308 is the HTTP response status code, which is similar to status code 301, which means that the requested resource has been replaced with the new uri as specified in the location header included in the response

    The 308 is the only code that indicates a permanent redirect and avoids automatic redirection from a POST method request to a GET method request.

    4xx code


    The server sends the HTTP 4xx response status code to the client when some error occurs in the request made by the client. This response indicates that the browser has sent an erroneous request with an error that the server could not process. In order to get the proper response, the client needs to send the correct request again.

    400 Invalid Requests


    If the web server is unable to serve the requested resource due to incorrect syntax, it sends back an HTTP request 400 invalid request in response.

    401 Unauthorized Request


    When some web page requires authentication, and the user tries to access the authenticated resource, the server sends a 401 Unauthorized Request response. For example, a web page is authenticated by a user id and password.

    402 Payment Required


    The HTTP 402 Payment Required response indicates that the client is required to make an online payment to process the request. This response status code is not a standard client error and is reserved for future use.

    403 Forbidden


    The server sends an HTTP 403 Forbidden response when the client sends a valid request, but the server is unable to service it.

    A 403 code is different from a 402. In a 402, the user must be authorized to access the web page, whereas in a 403, there is no authentication role. For example, a 403 is sent when several authorized users try to access a restricted page.

    404 Not Found


    The server sends a 404 Not Found error when the requested resource is not available on the server. The reason behind this error could be that the site owner has deleted the URL, or the user has typed the URL incorrectly.

    405 Method not Allowed


    The 405 Method not allowed response code is received when the server knows the requesting method, but the requested resource does not support it. In this case, the server generates an ALLOW header field that contains all methods supported by the target resource.

    406 Not Acceptable Request


    An HTTP 406 Not Acceptable Request response is generated when a client makes a request in a different format. The reason could be due to the different language or encoding method used in the HTTP Request.

    Code 5xx


    Error codes that fall under the 5xx range are sent to the client when some problem occurs with the server. When a client makes a request for some website, the browser sends the request to the website server, and if the website server is unable to service the request, then a 5xx error code is sent to the client. This error is generally used when the server is facing some problem or is unable to perform the request.

    The 5xx error message represents a server side error message where the website server is unable to successfully execute the request. A server-side error does not mean that the problem is with the website, computer or internet connection.

    500 Internal Server Error


    This error status code occurs when the server is unable to determine the problem and then stops responding to requests. This error can occur due to wrong server configuration. To fix this error, the website owner needs to check the server configuration and contact the web hosting company to fix it.

    501 Not Implemented


    The 501 Not Implemented HTTP error response code indicates that the server was unable to service the requested resource because the method specified in the request is not supported.

    502 Bad Gateways


    A 502 Bad Gateway response code means that the proxy server is not getting a response from the origin server or upstream server. If the edge server receives a 502 Bad Gateway from the origin server, it sends back a 500 Origin Not Reachable response to the client.

    503 Service Unavailable


    A 503 Service Unavailable response status code is sent when another request overloads the server, or the server is under maintenance.

    The difference between a 500 and a 503 is that in a 500 code, something went wrong in the server preventing it from handling the request, whereas, in a 503, the server is working fine and can also service the request but has chosen to send a 503 response.

    504 Gateway Timeout


    A 504 Gateway timeout error occurs when a server does not get a response from another upstream server that is required to complete the request. When a web server tries to load a page but doesn't get a response from the second server for the required information, then the web server uses 504 as the response code.

    505 HTTP version is not supported


    A 505 response code is sent if the server does not support the HTTP version specified in the HTTP request.

    507 Insufficient spaces


    507 Insufficient space is an HTTP response status code introduced by the WebDAV specification. This code is used to inform the client that the request cannot proceed because there is no available space on the disk.

    510 Extensions are missing


    When a client sends a request, it also sends the extension to be used automatically. If the server does not support the extension specified in the request, it sends 510 as a response code.

    Closing


    Thus a complete explanation of the meaning and causes of the HTTP status code. Hopefully the information presented can be useful. If you like articles like this, don't forget to visit the Network section for other interesting information.

    Post a Comment

    0 Comments

    Close Menu