Sobes.tech
Junior — Middle

Can you list the most common error codes and states that can occur on a server?

sobes.tech AI

Answer from AI

The most common error codes and server statuses encountered in web development and testing:

  • 1xx (Informational): 100 Continue, 101 Switching Protocols — rarely used directly.
  • 2xx (Success): 200 OK, 201 Created — request successfully processed.
  • 3xx (Redirection): 301 Moved Permanently, 302 Found — resource has been moved.
  • 4xx (Client errors):
    • 400 Bad Request — invalid request.
    • 401 Unauthorized — authentication required.
    • 403 Forbidden — access is forbidden.
    • 404 Not Found — resource not found.
    • 408 Request Timeout — timeout expired.
  • 5xx (Server errors):
    • 500 Internal Server Error — internal server error.
    • 502 Bad Gateway — bad response from upstream server.
    • 503 Service Unavailable — service unavailable (e.g., due to overload).
    • 504 Gateway Timeout — gateway timeout.

These codes help diagnose problems and correctly handle server responses in automated testing and monitoring.