HTTP Status Codes
5 min read Quiz at the end
2xx success, 4xx client errors, 5xx server errors — use precise status codes for clear API communication.
HTTP Status Codes
| Range | Meaning | Codes |
|---|
| 2xx | Success | 200 OK, 201 Created, 204 No Content |
| 3xx | Redirect | 301 Moved, 304 Not Modified |
| 4xx | Client Error | 400 Bad Request, 401 Unauth, 403 Forbidden, 404 Not Found, 422 Unprocessable, 429 Rate Limited |
| 5xx | Server Error | 500 Internal, 502 Bad Gateway, 503 Unavailable |
201 Created + Location: /api/users/42
204 No Content
400 Bad Request -- validation errors
401 Unauthorized + WWW-Authenticate header
429 Too Many Requests + Retry-After: 60
Topic Quiz · 3 questions
Test your understanding before moving on
1. Which status code should be returned after successfully creating a resource with POST?
💡 201 Created is the correct response for a successful POST that creates a new resource.
2. What status code indicates a client sent an invalid request (missing required field)?
💡 400 Bad Request indicates the client sent a malformed or invalid request.
3. What HTTP status code means the rate limit was exceeded?
💡 429 Too Many Requests is the standard rate-limiting response, often paired with a Retry-After header.