DEV Community

davinceleecode
davinceleecode Subscriber

Posted on

HTTP Status Codes Cheat Sheet πŸ“

1xx - Informational

  • Request received, continuing process.
  • Example: 100 Continue.

2xx - Success

  • The request was successfully received, understood, and accepted.
  • Common examples:
    • 200 OK β€” Standard response for successful requests (GET, PUT, PATCH, DELETE).
    • 201 Created β€” The request was successful and a new resource was created (POST).

3xx - Redirection

  • Further action needs to be taken to complete the request.
  • Example:
    • 301 Moved Permanently β€” Resource has been permanently moved to a new URL.

4xx - Client Error

  • The request contains bad syntax or cannot be fulfilled.
  • Common examples:
    • 400 Bad Request β€” The server could not understand the request.
    • 401 Unauthorized β€” Authentication is needed or failed.
    • 403 Forbidden β€” Server understood the request but refuses to authorize it.
    • 404 Not Found β€” The server cannot find the requested resource.

5xx - Server Error

  • The server failed to fulfill a valid request.
  • Common examples:
    • 500 Internal Server Error β€” The server encountered an unexpected condition.
    • 502 Bad Gateway β€” Server received an invalid response from an upstream server.
    • 503 Service Unavailable β€” The server is currently unavailable (overloaded or down for maintenance).

Notes:

  • 2xx means "successful operation."
  • 4xx errors are the client's fault (bad input, missing authentication, etc.).
  • 5xx errors are the server's fault (server crash, bug, or overload).

If you found this helpful, consider supporting my work at β˜• Buy Me a Coffee.

Top comments (0)