MTI TEK
  • Home
  • About
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All Resources
HTML | HTTP Status Codes
  1. Introduction to HTTP Status Codes
  2. 2xx Success Responses
  3. 3xx Redirection Responses
  4. 4xx Client Error Responses
  5. 5xx Server Error Responses

  1. Introduction to HTTP Status Codes
    HTTP status codes are three-digit numbers returned by web servers to indicate the result of a client's request. These codes are grouped into five categories, each representing a different type of response. Understanding these codes is essential for web developers, system administrators, and anyone working with web applications to diagnose issues and understand server-client communication.

    The first digit of the status code defines the category of response: 2xx indicates success, 3xx indicates redirection, 4xx indicates client errors, and 5xx indicates server errors. Each status code also includes a descriptive message that explains the meaning of the numeric code.

    See the wiki page for more details: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
  2. 2xx Success Responses
    Success status codes indicate that the client's request was received, understood, and processed successfully by the server. These codes confirm that the requested action was completed without any issues. The most common success codes are used for different types of successful operations.
    • Status Code: "200" - Message: "OK"
      The request was successful and the server returned the requested resource. This is the most common success response for GET requests.

    • Status Code: "201" - Message: "Created"
      The request was successful and a new resource was created as a result. This is typically returned after successful POST requests that create new data.

    • Status Code: "202" - Message: "Accepted"
      The request has been accepted for processing, but the processing is not yet complete. This is often used for asynchronous operations.

    • Status Code: "204" - Message: "No Content"
      The request was successful, but there is no content to return. This is commonly used for DELETE requests or PUT requests that don't return data.
  3. 3xx Redirection Responses
    Redirection status codes indicate that the client must take additional action to complete the request. These codes inform the client that the requested resource has moved to a different location or that an alternative resource should be used. Browsers typically handle these redirections automatically.
    • Status Code: "301" - Message: "Moved Permanently"
      The requested resource has been permanently moved to a new URL. Search engines will update their indexes to the new location, and browsers will cache this redirect.

    • Status Code: "302" - Message: "Found ("Moved Temporarily")"
      The requested resource has been temporarily moved to a different URL. The original URL should still be used for future requests, and search engines will not update their indexes.

    • Status Code: "307" - Message: "Temporary Redirect"
      Similar to 302, but guarantees that the HTTP method will not change when redirecting. This ensures that POST requests remain POST requests after redirection.
  4. 4xx Client Error Responses
    Client error status codes indicate that the request contains bad syntax or cannot be fulfilled due to an issue with the client's request. These errors suggest that the client needs to modify the request before resubmitting it. The server was unable to process the request due to something that appears to be a client error.
    • Status Code: "400" - Message: "Bad Request"
      The server cannot process the request due to malformed syntax, invalid request message framing, or deceptive request routing.

    • Status Code: "401" - Message: "Unauthorized"
      The request requires authentication. The client must authenticate itself to get the requested response, typically by providing valid credentials.

    • Status Code: "403" - Message: "Forbidden"
      The server understood the request but refuses to authorize it. The client does not have permission to access the requested resource.

    • Status Code: "404" - Message: "Not Found"
      The server cannot find the requested resource. This is one of the most well-known status codes, indicating that the URL does not exist on the server.

    • Status Code: "405" - Message: "Method Not Allowed"
      The HTTP method used in the request is not supported for the requested resource. For example, trying to POST to a resource that only accepts GET requests.

    • Status Code: "406" - Message: "Not Acceptable"
      The server cannot produce a response that matches the list of acceptable values defined in the request's proactive content negotiation headers.

    • Status Code: "407" - Message: "Proxy Authentication Required"
      Similar to 401, but authentication is required with a proxy server before the request can be processed.

    • Status Code: "408" - Message: "Request Timeout"
      The server timed out waiting for the request. The client took too long to send the complete request within the server's timeout period.

    • Status Code: "409" - Message: "Conflict"
      The request conflicts with the current state of the server. This often occurs when there are concurrent modifications to the same resource.

    • Status Code: "413" - Message: "Request Too Long"
      The request entity is larger than limits defined by the server. The server may close the connection or return a Retry-After header field.

    • Status Code: "414" - Message: "Request-URI Too Long"
      The URI requested by the client is longer than the server is willing to interpret. This is rare but can occur with very long query strings.

    • Status Code: "415" - Message: "Unsupported Media Type"
      The server does not support the media format of the requested data, so the server is rejecting the request.

    • Status Code: "419" - Message: "Insufficient Space On Resource"
      The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.

    • Status Code: "420" - Message: "Method Failure"
      The method was not executed on a particular resource within its scope because some part of the method's execution failed.

    • Status Code: "423" - Message: "Locked"
      The resource that is being accessed is locked, typically as part of a WebDAV protocol where resources can be locked for exclusive access.
  5. 5xx Server Error Responses
    Server error status codes indicate that the server failed to fulfill a valid request due to an error on the server side. These codes suggest that the issue is with the server's ability to process the request, not with the request itself. The client may be able to repeat the request at a later time when the server issue is resolved.
    • Status Code: "500" - Message: "Internal Server Error"
      The server encountered an unexpected condition that prevented it from fulfilling the request. This is a generic error message when no specific error code is appropriate.

    • Status Code: "502" - Message: "Bad Gateway"
      The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed while attempting to fulfill the request.

    • Status Code: "503" - Message: "Service Unavailable"
      The server is currently unavailable due to temporary overload or scheduled maintenance. The service is expected to be restored after some delay.

    • Status Code: "504" - Message: "Gateway Timeout"
      The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server it needed to access to complete the request.

    • Status Code: "507" - Message: "Insufficient Storage"
      The server is unable to store the representation needed to complete the request. This typically occurs when the server runs out of disk space.
© 2025 mtitek