WEB & HTTP
HTTP status codes are three-digit responses used by web servers and other HTTP systems to describe the result or current state of a request. They are divided into five broad classes.
The status code is only one part of an HTTP response. Headers, redirects, authentication, caching, application behavior, and the response body can all affect what happens next.
Status Code Classes
| Range | Class | General Meaning |
|---|---|---|
| 100–199 | Informational | The request has been received or processing is continuing. |
| 200–299 | Success | The request was successfully received, understood, or processed. |
| 300–399 | Redirection | The client may need to follow another location or take additional action. |
| 400–499 | Client Error | The request cannot be fulfilled because of something associated with the request. |
| 500–599 | Server Error | The server encountered a condition that prevented it from fulfilling the request. |
Common HTTP Status Codes
| Code | Name | Typical Meaning |
|---|---|---|
| 200 | OK | The request succeeded. |
| 201 | Created | A new resource was successfully created. |
| 202 | Accepted | The request was accepted for processing, but processing may not be complete. |
| 204 | No Content | The request succeeded without returning response content. |
| 301 | Moved Permanently | The resource has a permanent redirect to another location. |
| 302 | Found | The resource is temporarily available at another location. |
| 304 | Not Modified | The cached representation can generally be reused because the resource has not changed. |
| 307 | Temporary Redirect | The client should temporarily use another location while preserving the request method. |
| 308 | Permanent Redirect | The client should permanently use another location while preserving the request method. |
| 400 | Bad Request | The server cannot process the request because it is invalid or malformed. |
| 401 | Unauthorized | Authentication is required or was not successfully provided. |
| 403 | Forbidden | The server understood the request but refuses to fulfill it. |
| 404 | Not Found | The requested resource could not be found. |
| 405 | Method Not Allowed | The resource does not support the HTTP method used. |
| 408 | Request Timeout | The server did not receive a complete request within the time it was prepared to wait. |
| 409 | Conflict | The request conflicts with the current state of the target resource. |
| 410 | Gone | The resource is no longer available and is not expected to return. |
| 429 | Too Many Requests | The client has sent too many requests within a given period. |
| 500 | Internal Server Error | The server encountered an unexpected condition. |
| 501 | Not Implemented | The server does not support the functionality required to fulfill the request. |
| 502 | Bad Gateway | A gateway or proxy received an invalid response from an upstream server. |
| 503 | Service Unavailable | The server is temporarily unable to handle the request. |
| 504 | Gateway Timeout | A gateway or proxy did not receive a timely response from an upstream server. |
401 vs 403
A 401 response generally indicates that authentication is required or has not been successfully provided. A 403 response indicates that the server understood the request but refuses to fulfill it. Authentication and authorization designs can vary between applications.