Contents

    HTTP Status Codes List: Complete Guide and Examples

    A complete list of HTTP status codes with detailed explanations. We have compiled all 96 HTTP response codes (63 common and 33 custom) to help you better understand their purpose and proper usage in web development.
    Codes 1xx
    100 ContinueThe server has received the initial part of the request and is waiting for the rest.
    101 Switching ProtocolsThe client has requested a protocol switch, and the server is executing the change.
    102 ProcessingThe server has accepted the request, but processing is taking longer than expected.
    103 Early HintsThe server is sending headers in advance before the complete response is prepared.
    Codes 2xx
    200 OKThe request has been successfully processed, and the server has provided the requested data.
    201 CreatedThe resource has been successfully created. The server includes a Location header with the address of the created resource.
    202 AcceptedThe request has been accepted, but processing will be completed later. The response may contain additional status information.
    203 Non-Authoritative InformationThe response contains information obtained from a third-party source rather than the main server.
    204 No ContentThe server successfully processed the request but returns no content. The browser should not update the current document.
    205 Reset ContentThe client should reset the input form used in the current interaction.
    206 Partial ContentThe server is sending only part of the requested resource, as specified in the Content-Range header.
    207 Multi-StatusThe response contains multiple independent status codes for different parts of the request.
    208 Already ReportedThe element has already been listed earlier in the same response.
    218 This is fineAn unofficial code indicating that the server successfully processed the request but with minor issues.
    226 IM UsedThe server completed a GET request and used one or more resource transformation algorithms.
    Codes 3xx
    300 Multiple ChoicesThe requested resource is available in multiple variants. The server can provide a list of possible options.
    301 Moved PermanentlyThe resource has been permanently moved to a new address specified in the Location header.
    302 FoundThe resource is temporarily available at a different address, but the old URL may be used again in the future.
    303 See OtherThe resource is available at another address specified in the Location header.
    304 Not ModifiedThe resource has not been modified since the last request, and the cached version is used.
    305 Use ProxyAccess to the resource is only possible through the specified proxy server.
    306 Switch ProxyThis code is reserved but not used in modern HTTP implementations.
    307 Temporary RedirectThe resource has been temporarily moved, but the request method must remain unchanged.
    308 Permanent RedirectThe resource has been permanently moved to a new URL, and the request method must be preserved.
    Codes 4xx
    400 Bad RequestThe request is invalid due to a syntax error.
    401 UnauthorizedUser authentication is required to access the resource.
    402 Payment RequiredAccess to the resource requires payment.
    403 ForbiddenAccess to the resource is denied by the server.
    404 Not FoundThe requested resource could not be found.
    405 Method Not AllowedThe request method is not supported by the server for this resource.
    406 Not AcceptableThe server response format does not match what the client requested.
    407 Proxy Authentication RequiredAuthentication through a proxy server is needed.
    408 Request TimeoutThe request timed out; the connection was closed.
    409 ConflictThe request cannot be completed due to a conflict with the current state of the resource.
    410 GoneThe requested resource is no longer available and will not be restored.
    411 Length RequiredThe server requires the Content-Length header.
    412 Precondition FailedOne of the preconditions in the request was not met.
    413 Payload Too LargeThe request size exceeds the allowed server limit.
    414 URI Too LongThe requested URI is too long for the server to process.
    415 Unsupported Media TypeThe request data format is not supported by the server.
    416 Range Not SatisfiableThe requested range cannot be fulfilled by the server.
    417 Expectation FailedThe server cannot meet the requirements of the Expect header.
    418 I’m a TeapotThe server refuses to brew coffee because it is a teapot.
    419 Page ExpiredThe user session has expired.
    420 Method FailureMethod failure.
    420 Enhance Your CalmToo many requests; please reduce the load.
    421 Misdirected RequestThe request was sent to a server that cannot process it.
    422 Unprocessable EntityThe server cannot process the request due to a content error.
    423 LockedAccess to the resource is locked.
    424 Failed DependencyThe request failed due to a failure in a dependent request.
    425 Too EarlyThe server refuses to process the request because it was sent too early.
    426 Upgrade RequiredThe client must upgrade to a different protocol to complete the request.
    428 Precondition RequiredThe server requires the request to meet specific preconditions.
    429 Too Many RequestsThe client has sent too many requests in a short time.
    430 Shopify Security RejectionThe request was rejected by Shopify’s security system.
    430 Shopify Security RejectionThe request was rejected by Shopify’s security system.
    431 Request Header Fields Too LargeThe request headers are too large for the server to process.
    440 Login Time-outThe user session has expired.
    444 No ResponseThe server closed the connection without sending a response.
    449 Retry WithAdditional information is required to process the request.
    450 Blocked by Windows Parental ControlsAccess to the resource is restricted by Windows parental controls.
    451 Unavailable For Legal ReasonsAccess to the resource is restricted due to legal reasons.
    494 Request Header Too LargeThe request header is too large for the server to process.
    495 SSL Certificate ErrorThe SSL certificate presented by the client is invalid.
    496 SSL Certificate RequiredA valid SSL certificate is required to access this resource.
    497 HTTP Request Sent to HTTPS PortThe client sent an HTTP request to an HTTPS-only port.
    498 Invalid TokenThe token provided in the request is invalid or has expired.
    499 Client Closed RequestThe client closed the connection before receiving a server response.
    Codes 5xx
    500 Internal Server ErrorAn internal server error occurred, and the request could not be processed.
    501 Not ImplementedThe request cannot be processed because the server does not support the required functionality.
    502 Bad GatewayThe server received an invalid response from another server while processing the request.
    503 Service UnavailableThe server is temporarily unable to handle the request due to overload or maintenance.
    504 Gateway Time-outThe time limit for waiting for a response from another server or gateway has been exceeded.
    505 HTTP Version not supportedThe HTTP version used is not supported by the server.
    506 Variant Also NegotiatesServer configuration error, where the variant selection also participates in negotiation.
    507 Insufficient StorageThe server cannot complete the request due to a lack of memory or disk space.
    508 Loop DetectedAn infinite loop was detected while processing the request.
    509 Bandwidth Limit ExceededThe server’s bandwidth limit has been exceeded.
    510 Not ExtendedThe request requires additional extensions that are not supported by the server.
    511 Network Authentication RequiredNetwork authentication is required to access the resource.
    520 Unknown ErrorAn unknown server error occurred.
    521 Web Server Is DownThe web server is unavailable.
    522 Connection Timed OutThe connection timeout has been exceeded.
    523 Origin Is UnreachableThe resource origin is unreachable.
    524 A Timeout OccurredThe request timeout has been exceeded.
    525 SSL Handshake FailedThe SSL handshake failed.
    526 Invalid SSL CertificateThe SSL certificate is invalid.
    527 Railgun ErrorThere was a connection error via Railgun.
    529 Site is overloadedThe site is overloaded with requests.
    530 Site is frozenThe site is frozen and unavailable.
    530 Origin DNS ErrorThere was a DNS error on the origin side.
    540 Temporarily DisabledThe server is temporarily disabled.
    598 Network read timeout errorThere was a network read error due to timeout.
    599 Network Connect Timeout ErrorThere was a connection error due to timeout.
    Other
    783 Unexpected Token (Shopify)Unexpected token in Shopify request.
    999 Non-standardNon-standard error code.

    Understanding HTTP Status Codes: A Comprehensive Guide

    The Hypertext Transfer Protocol (HTTP) serves as the foundation of data communication on the World Wide Web. Among its various features, HTTP status codes play a crucial role in conveying the outcome of a request made to a server. These codes provide essential feedback to both developers and users, indicating whether a request was successful, encountered an error, or requires further action.

    A Detailed Look at Standard HTTP Status Codes

    HTTP status codes are categorized into five classes based on their first digit. Each category conveys different information regarding the response of the server. Here’s a breakdown:

    • 1xx (Informational): Indicates that the request has been received and is being processed.
    • 2xx (Successful): Confirms that the client’s request was successfully received, understood, and accepted.
    • 3xx (Redirection): Suggests that the client must take additional action to complete the request.
    • 4xx (Client Error): Indicates that there was an error with the request from the client’s side.
    • 5xx (Server Error): Signifies that the server failed to fulfill a valid request.

    Comprehensive List of Standard HTTP Status Codes

    Status Code Description Category
    200 OK: The request has succeeded. 2xx
    201 Created: The request has been fulfilled and resulted in a new resource being created. 2xx
    204 No Content: The server successfully processed the request, but is not returning any content. 2xx
    301 Moved Permanently: This and all future requests should be directed to the given URI. 3xx
    404 Not Found: The server can’t find the requested resource. 4xx
    500 Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request. 5xx

    User-Defined HTTP Status Codes

    While the above-mentioned standard codes are widely recognized, user-defined status codes also play a vital role in customizing responses for specific applications. Commonly used custom codes include those employed by APIs to indicate unique application states or errors.

    1. 600: Another Error: Used by certain applications to identify generic errors.
    2. 700: Custom Validation Error: Indicates validation failure during processing.
    3. 800: Resource Gone: A code utilized when the requested resource is no longer available.

    Best Practices for Utilizing HTTP Status Codes

    To effectively leverage HTTP status codes in web development, adherence to best practices is paramount. Developers should ensure that:

    • Correct codes are returned based on the nature of the request and response.
    • Error handling mechanisms are established to provide informative feedback to users.
    • Custom codes are well-documented within the API to enhance clarity and usability.

    Conclusion

    In summary, understanding HTTP status codes is essential for web developers and anyone involved in creating or managing web applications. Mastery over these codes enables more effective communication between clients and servers, enhances user experience, and aids in quicker troubleshooting of potential issues. By distinguishing between standard and user-defined codes, developers can tailor their responses accurately according to the application’s requirements.