DEV Community

davinceleecode
davinceleecode

Posted on

2 1 2 2 1

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)