Skip to content

Latest commit

Β 

History

History
71 lines (53 loc) Β· 2.74 KB

File metadata and controls

71 lines (53 loc) Β· 2.74 KB

🌐 HTTP Status Codes – Complete Notes

HTTP status codes are grouped into 5 categories based on their first digit.
Each category has common codes you should know for development and interviews.


πŸ”Ή 1xx – Informational

  • Request was received and understood.
  • Server is still processing the request.
  • Rarely seen in practice.

Common Codes

  • 100 Continue β†’ Initial part of request received, client should continue.
  • 101 Switching Protocols β†’ Protocol change requested by client is accepted.
  • 102 Processing β†’ Server has received request and is processing, but no response yet.

πŸ”Ή 2xx – Success

  • Request was successfully received, understood, and processed.

Common Codes

  • 200 OK β†’ Standard success response.
  • 201 Created β†’ Resource successfully created.
  • 202 Accepted β†’ Request accepted for processing, not completed yet.
  • 204 No Content β†’ Request processed successfully, no response body.

πŸ”Ή 3xx – Redirection

  • Further action needed to complete the request.
  • Often used for URL redirects.

Common Codes

  • 301 Moved Permanently β†’ Resource moved to a new permanent URL.
  • 302 Found β†’ Temporary redirect.
  • 304 Not Modified β†’ Cached version can be used, no need to download again.
  • 307 Temporary Redirect β†’ Similar to 302, but keeps request method (e.g., POST stays POST).
  • 308 Permanent Redirect β†’ Like 301, but keeps request method.

πŸ”Ή 4xx – Client Error

  • Error occurred on the client’s side.
  • Usually due to bad requests, missing data, or lack of permissions.

Common Codes

  • 400 Bad Request β†’ Invalid syntax or malformed request.
  • 401 Unauthorized β†’ Authentication required (or failed).
  • 403 Forbidden β†’ Client authenticated but not allowed to access resource.
  • 404 Not Found β†’ Resource not found on the server.
  • 405 Method Not Allowed β†’ HTTP method not supported by resource.
  • 408 Request Timeout β†’ Client took too long to send request.
  • 429 Too Many Requests β†’ Client sent too many requests in a given time.

πŸ”Ή 5xx – Server Error

  • Error occurred on the server’s side while processing request.

Common Codes

  • 500 Internal Server Error β†’ Generic server failure.
  • 501 Not Implemented β†’ Server does not support requested functionality.
  • 502 Bad Gateway β†’ Invalid response from upstream server.
  • 503 Service Unavailable β†’ Server overloaded or down for maintenance.
  • 504 Gateway Timeout β†’ Upstream server did not respond in time.
  • 505 HTTP Version Not Supported β†’ Server doesn’t support requested HTTP version.