Skip to content

Glossary: Building APIs with FastAPI

HTTP status codes

Also written: Status code, status codes, 200, 201, 204, 307, 401, 403, 404, 405, 409, 422, 500, redirect, Unprocessable Entity

A response's three-digit result: 2xx means success, 4xx a client mistake, 5xx a server bug. Common ones: 200 OK (success), 201 Created (after a POST), 204 No Content (after a DELETE), 307 Temporary Redirect (sent to the `location` header's URL, e.g. for a trailing slash), 401 Unauthorized (who are you?), 403 Forbidden (known, but not allowed), 404 Not Found (no such thing), 405 Method Not Allowed (path exists, wrong method), 409 Conflict (valid but clashes with stored data), 422 Unprocessable Content (data failed validation) and 500 Internal Server Error (a bug in your code).

Where the book teaches it

Related terms

HTTPExceptionValidationAuthentication / authorizationMethod