HTTP Status Codes

HTTP status codes are three-digit numbers returned by a server in response to a client’s request made to the server. They provide information about the status of the request and whether it was successful, encountered an error, or requires further action from the client. Status codes are grouped into five classes, each representing a different type of response. Here are some of the common HTTP status codes:

  1. 1xx (Informational):
    • 100 Continue: The server has received the initial part of the request, and the client should proceed with the remainder.
  2. 2xx (Successful):
    • 200 OK: The request was successful, and the server has returned the requested data.
    • 201 Created: The request was successful, and a new resource was created as a result.
    • 204 No Content: The server successfully processed the request, but there is no content to send in the response.
  3. 3xx (Redirection):
    • 301 Moved Permanently: The requested resource has been permanently moved to a new location.
    • 302 Found (or Moved Temporarily): The requested resource has been temporarily moved to a different location.
    • 304 Not Modified: The client’s cached copy of the resource is still valid, and the server has not modified the resource since it was last requested.
  4. 4xx (Client Error):
    • 400 Bad Request: The server could not understand the request due to malformed syntax or other client error.
    • 401 Unauthorized: The request requires user authentication.
    • 403 Forbidden: The server understood the request but refuses to authorize it.
    • 404 Not Found: The requested resource could not be found on the server.
  5. 5xx (Server Error):
    • 500 Internal Server Error: A generic error message indicating that an unexpected condition was encountered on the server.
    • 501 Not Implemented: The server does not support the functionality required to fulfill the request.
    • 502 Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed.
    • 503 Service Unavailable: The server is currently unable to handle the request due to temporary overloading or maintenance of the server.

These status codes provide a concise way for clients to understand the outcome of their requests and take appropriate action. They are an essential part of the HTTP protocol and are utilized in web development, API interactions, and various other online communication scenarios.

Leave a comment