HTTP Status Codes

Duration: 5 min•Difficulty: Easy•

When an API responds, it provides a numeric code to indicate the status of the request.

Status Code Illustration

Status Code Illustration

Important Categories

  1. 2xx (Success): Success.
  • 200 OK: Request successful.
  • 201 Created: Data successfully created (usually after POST).
  1. 4xx (Client Error): Error on the user side.
  • 400 Bad Request: Invalid input data.
  • 401 Unauthorized: You are not logged in (no token).
  • 404 Not Found: URL or data not found.
  1. 5xx (Server Error): Error on the server side.
  • 500 Internal Server Error: Server crash or bug in the backend code.