Blog, COLDSURF

HTTP Status Code

#http

When a web browser makes an HTTP request to a server, the status code indicates whether the request was successful or failed, and what action to take next.

There are five main groups of HTTP status codes.

1xx (Information): Informational Responses

  • 100 (continue): The server has received the request header and the client is sending the request body.
  • 101 (switching protocols): The client is asking the server to switch protocols.
  • 102 (processing): The client has made a request and the server is processing it, but there is no response yet.
  • 103 (checkpoint): Used for recovering interrupted PUT and POST requests.

2xx (Successful): Successful Responses

  • 200 (ok): The request was successful and the response is returned without errors.
  • 201 (created): The request was successful, and a new resource has been created.
  • 202 (accepted): The request was accepted for processing, but the processing has not been completed yet.
  • 203 (non-authoritative information): The server returned some of the requested information but not the full response.
  • 204 (no content): The request was successful, but there is no content to return. Often used for delete requests.
  • 205 (reset content): No content is returned, and the client’s view needs to be reset.
  • 206 (partial content): The server is sending only a partial response due to a range request by the client.
  • 207 (multi-status): A response that contains multiple status codes for multiple resources.
  • 208 (multi-status): Used in WebDAV to avoid listing the same internal members multiple times in a response.
  • 226 (IM Used): The server has successfully processed a resource using one or more instance manipulations.

3xx (Redirection): Redirection Responses

  • 300 (Multiple Choices): The client can choose from a set of options (e.g., several links).
  • 301 (permanently moved): The requested page has been permanently moved to a new URL.
  • 302 (found): The requested page has been temporarily moved to a new URL.
  • 303 (see other): The requested page can be found at another URL.
  • 304 (not modified): The page has not been modified since the last request.
  • 305 (use proxy): The client must use a proxy as specified in the location field.
  • 306 (switch proxy): A deprecated code that is not used.
  • 307 (Temporary Redirect): Similar to 302 Found but the client must use the same HTTP method.
  • 308 (Permanent Redirect): Similar to 301 Moved Permanently but the client must use the same HTTP method.

4xx (Client Error): Client Error Responses

  • 400 (Bad Request): The request contains a syntax error, and the server cannot understand it.
  • 401 (Unauthorized): The request requires authentication and the client is not authorized.
  • 402 (Payment Required): A status code that is not currently in use but may be used in the future for payment-related issues.
  • 403 (Forbidden): The client is authenticated, but does not have permission to access the requested resource.
  • 404 (Not Found): The requested resource cannot be found.
  • 405 (Method Not Allowed): The HTTP method used is not allowed for the resource.
  • 406 (Not Acceptable): The requested resource is not acceptable according to the Accept header in the request.
  • 407 (Proxy Authentication Required): Authentication is required by the proxy server.
  • 408 (Request Timeout): The server timed out waiting for the request.
  • 409 (Conflict): The request could not be completed due to a conflict, such as attempting to create a resource that already exists.
  • 410 (Gone): The requested resource is no longer available.
  • 411 (Length Required): The Content-Length header is missing, and the request cannot be processed.
  • 412 (Precondition Failed): One of the preconditions in the request header was not met by the server.
  • 413 (Request Entity Too Large): The request is too large for the server to process.
  • 414 (Request-URI Too Long): The request URI is too long.
  • 415 (Unsupported Media Type): The server cannot process the media type of the request.
  • 416 (Requested Range Not Satisfiable): The client requested a part of the resource that the server cannot provide.
  • 417 (Expectation Failed): The server cannot meet the requirements of the Expect header.
  • 418 (I'm a teapot): This is an April Fools' joke from 1998, where a teapot refuses to make coffee, referencing the Hyper Text Coffee Pot Control Protocol (HTCPCP).
  • 422 (Unprocessable Entity): The request was well-formed, but there was an issue with the entity (e.g., invalid data).
  • 429 (Too Many Requests): The client has sent too many requests in a short time.

5xx (Server Error): Server Error Responses

  • 500 (Internal Server Error): A generic server error that occurs when the server is unable to handle the request.
  • 501 (Not Implemented): The server does not support the functionality required to fulfill the request.
  • 502 (Bad Gateway): The gateway or proxy server encountered an error or is overloaded.
  • 503 (Service Unavailable): The server is temporarily unavailable due to maintenance or overload.
  • 504 (Gateway Timeout): The gateway or proxy server did not receive a timely response from the upstream server.
  • 505 (HTTP Version Not Supported): The server does not support the HTTP version used in the request.
  • 511 (Network Authentication Required): The client must authenticate to gain network access.
References:
← Go home