Http Status Codes
HTTP status codes are 3-digit numbers that a server sends back to the client (like a browser or API consumer) to indicate the result of the request. They are categorized into 5 main types (classes) based on the first digit.
| Code Range | Type | Meaning |
|---|---|---|
| 1xx | Informational | Request received, continuing process |
| 2xx | Success | Request successfully received & handled |
| 3xx | Redirection | Further action needed to complete the request |
| 4xx | Client Error | The request contains bad syntax or cannot be fulfilled |
| 5xx | Server Error | Server failed to fulfill a valid request |
1xx - Informational
These codes indicate that the request was received and is being processed.
| Code Range | Type | Meaning |
|---|---|---|
| 100 | Continue | Server received request headers, waiting for body. |
| 101 | Switching Protocols | Client asked server to switch protocols (e.g., HTTP → WebSocket). |
2xx - Success
The request was successfully received, understood, and accepted.
| Code Range | Type | Meaning |
|---|---|---|
| 200 | Ok | The request was successful. |
| 201 | Created | Resource was created successfully (e.g., after POST). |
| 202 | Accepted | Request accepted but processing not completed yet. |
| 204 | No Content | Successful, but no content to return. |
3xx - Redirection
Client must take additional steps to complete the request.
| Code Range | Type | Meaning |
|---|---|---|
| 301 | Moved Permanently | Resource has permanently moved to a new URL. |
| 302 | Found | Temporarily moved to another URL. |
| 304 | Not Modified | Cached version is still valid, no new data sent. |
4xx - Client Error
The request was invalid or cannot be processed by the server.
| Code Range | Type | Meaning |
|---|---|---|
| 400 | Bad Request | Request syntax is invalid. |
| 401 | Unauthorized | Requires authentication. |
| 403 | Forbidden | Authenticated but not allowed to access. |
| 404 | Not Found | The requested resource doesn’t exist. |
| 405 | Method Not Allowed | HTTP method not allowed for this route. |
| 429 | Too Many Requests | Rate limit exceeded. |
5xx - Server Error
The request was invalid or cannot be processed by the server.
| Code Range | Type | Meaning |
|---|---|---|
| 500 | Internal Server Error | Generic server error. |
| 502 | Bad Gateway | Server received an invalid response from upstream. |
| 503 | Service Unavailable | Server is down or overloaded. |
| 504 | Gateway Timeout | Server took too long to respond. |