HTTP status codes¶
List of HTTP status codes - Wikipedia
201 Created | |
202 Accepted | Request has been accepted for processing, example: export as XLSX/CSV |
204 No Content | Save/update and continue, response for a PUT |
301 - permanent redirect - only good for SEO
400: Bad Request | |
401: Unauthorized | Not logged in |
402: Payment Required | Non Standard! Paywall, Garmin: uses this when it should use a 403 |
403: Forbidden | Need to be logged in or you don't have the permissions |
409: Conflict | example: version control conflict (uploading file that's older than the file on the server) |
429: Too many requests |
- 502
- bad gateway
- proxy got a bad response from the other server
- storybook.formaai.com: when Jenkins is out of memory
Python¶
Django¶
Requests¶
https://stackoverflow.com/a/61463451
response.raise_for_status()
throws an error on any 400+ status code
response.ok
is a boolean of whether the status code is less than 400
Last update:
2023-04-24