Sobes.tech
Junior

What response codes does a web server return?

sobes.tech AI

Answer from AI

The web server returns standard HTTP status codes informing the client about the result of processing its request. Main categories:

  • 1xx Informational: Request received, process continuing.
  • 2xx Success: Action successfully received, understood, and accepted.
  • 3xx Redirection: Additional actions are needed to complete the request.
  • 4xx Client Error: The request contains incorrect syntax or cannot be fulfilled.
  • 5xx Server Error: The server failed to complete a valid request.

Most common codes:

  • 200 OK: The request was successfully processed.
  • 201 Created: The request was successful, and a new resource was created as a result.
  • 204 No Content: The request was successful, but the response contains no content.
  • 301 Moved Permanently: The resource has been permanently moved to a new URL.
  • 302 Found (formerly Moved Temporarily): The resource has been temporarily moved.
  • 400 Bad Request: The server cannot process the request due to a client error.
  • 401 Unauthorized: Authentication is required.
  • 403 Forbidden: The server understood the request but refuses to authorize it.
  • 404 Not Found: The server cannot find the requested resource.
  • 500 Internal Server Error: Internal server error.
  • 503 Service Unavailable: The server is temporarily unavailable, usually due to overload or maintenance.