14 Jan 2023
Status codes inform client of the outcome of its request and potentially how to handle it. Can be broken into 5 different ranges:
| Range | Type | Description |
|---|---|---|
| 100-199 | Information Response |
Tells client first part of request has been accepted and it should continue sending the rest of the request. (No longer common) |
| 200-299 | Success | Tells client the request was successful. |
| 300-399 | Redirection | Redirects the request to another resource, whether different page or entirely different site. |
| 400-499 | Client Errors |
Informs client there was an error with the request. |
| 500-599 | Server Errors |
For server-side errors, usually indicating a major problem with the server handling the request. |
Most common status codes:
| Code | Name | Description |
|---|---|---|
| 200 | OK | Request completed successfully. |
| 201 | Created | A resource has been created. (i.e. new user or blog post) |
| 301 | Permanent Redirect |
Redirects browser to new webpage or tells search engines the page has moved and where to look. |
| 302 | Temporary Redirect |
Same as above but that it might change again in the near future. |
| 400 | Bad Request |
Tells the browser something was either wrong or missing in the request. (i.e. resource expecting a parameter not received) |
| 401 | Not Authorized |
Not currently allowed to view resource until authorized with webapp. |
| 403 | Forbidden | No permission to view resource whether logged in or not. |
| 404 | Page Not Found |
Page/resource requested doesn’t exist. |
| 405 | Method Not Allowed |
Resource does not allow this method request. (i.e. GET request received when expecting POST) |
| 500 | Internal Service Error |
Server encountered some sort of error the request that it doesn’t know how to handle. |
| 503 | Service Unavailable |
Server can’t handle request because overloaded or down for maintenance. |
Provide status code numbers for certain situations.