HTTP status code

Table of contents

Definition: HTTP status codes are standard response codes that web servers use to communicate the status of a client’s request.

Importance: Essential for debugging, enhancing UX, and SEO.

Structure of HTTP Status Codes πŸ› οΈ

  • 3-Digit Number: Each code consists of three digits, where the first digit signifies the category.

  • Categories: Five classes indicating response types (informational, success, redirection, client error, server error).

1xx - Informational Responses πŸ”

  • 100 Continue: The server has received the request headers and the client should proceed.

  • 101 Switching Protocols: The client requests to switch protocols; the server agrees.

2xx - Success βœ…

  • 200 OK: Standard response for successful requests.

  • 201 Created: New resource successfully created.

  • 204 No Content: Success, but no content to return.

3xx - Redirection πŸ”„

  • 301 Moved Permanently: The resource has a new URL; use the new location.

  • 302 Found: Resource temporarily moved; use original URL in the future.

  • 304 Not Modified: The cached version is still valid; no need to re-download.

4xx - Client Errors 🚫

  • 400 Bad Request: Client error in request syntax.

  • 401 Unauthorized: Authentication required or failed.

  • 403 Forbidden: The Server understands the request but refuses it.

  • 404 Not Found: Resource not found on the server.

  • 429 Too Many Requests: The client has sent too many requests in a short time.

5xx - Server Errors πŸ”§

  • 500 Internal Server Error: General server error; something went wrong.

  • 502 Bad Gateway: The server received an invalid response from an upstream server.

  • 503 Service Unavailable: The server is overloaded or under maintenance.

  • 504 Gateway Timeout: Upstream server failed to send a timely response.

0
Subscribe to my newsletter

Read articles from Sameer Sheikh Mansoori directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sameer Sheikh Mansoori
Sameer Sheikh Mansoori