Overview
This lecture explains HTTP status codes, their categories, and key examples, as well as unofficial codes and usage in popular web server software.
HTTP Status Code Basics
- HTTP status codes are sent by servers in response to client requests to indicate the outcome.
- The first digit of the code determines its class: informational, success, redirection, client error, server error.
- IANA maintains the official registry of HTTP status codes.
Classes of HTTP Status Codes
- 1xx: Informational responses; request received, process continues.
- 2xx: Successful responses; request received, understood, and accepted.
- 3xx: Redirection; further action needed to complete the request.
- 4xx: Client errors; problem with client's request.
- 5xx: Server errors; server failed to process valid request.
Common Standard Codes by Class
- 1xx: 100 Continue, 101 Switching Protocols, 102 Processing, 103 Early Hints.
- 2xx: 200 OK, 201 Created, 202 Accepted, 204 No Content, 206 Partial Content.
- 3xx: 300 Multiple Choices, 301 Moved Permanently, 302 Found, 304 Not Modified, 307 Temporary Redirect, 308 Permanent Redirect.
- 4xx: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 405 Method Not Allowed, 409 Conflict, 418 I'm a teapot, 429 Too Many Requests, 451 Unavailable For Legal Reasons.
- 5xx: 500 Internal Server Error, 501 Not Implemented, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout, 511 Network Authentication Required.
Unofficial and Vendor-Specific Codes
- Codes like 418 (I'm a teapot), 419 (Page Expired), 509 (Bandwidth Limit Exceeded), and 599 (Network Connect Timeout) are not part of the HTTP standard.
- Web servers like IIS, nginx, and services like Cloudflare and AWS Elastic Load Balancing have their own additional codes (e.g. 444, 520, 561).
Caching Warning Codes (Obsolete)
- Warning header codes (e.g., 110 Response is Stale, 111 Revalidation Failed) have been obsoleted and are no longer used.
Key Terms & Definitions
- HTTP Status Code — A 3-digit number indicating the result of a server's attempt to process a client request.
- IANA — Internet Assigned Numbers Authority; maintains status code registry.
- Redirection (3xx) — Tells the client to take additional action, like fetching a different URL.
- Client Error (4xx) — Indicates an issue with the client's request.
- Server Error (5xx) — Indicates an error or failure on the server's side.
Action Items / Next Steps
- Review the main categories and memorize the most common standard codes.
- Explore additional status codes relevant to your specific server environment.
- Ensure understanding of how error codes impact user experience and troubleshooting.