Skip to content

HTTP status codes

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
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

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

response = requests.get(url)
response.raise_for_status()

Last update: 2022-09-23