HTTP Status Code Categories
Status codes are grouped by the first digit: 2xx success, 3xx redirection, 4xx client errors, and 5xx server errors. Understanding these helps you debug APIs, fix frontend fetch handlers, and configure reverse proxies correctly.
Frequently Asked Questions
What is the difference between 401 and 403?
401 Unauthorized means authentication is required or failed โ the client should provide credentials. 403 Forbidden means the server understood the request but refuses to authorize it, even with valid credentials.
When should I return 204 vs 200?
Use 204 No Content when the operation succeeded but there is no response body (e.g. DELETE). Use 200 OK when you return data in the response body.