Three-digit numbers that servers send to indicate the result of an HTTP request (success, error, redirect, etc.).
HTTP status codes are three-digit numbers that tell you what happened with your web request. Did it succeed? Was there an error? Do you need to log in? The status code answers these questions.
Every time you visit a website or call an API, you get a status code back - even if you do not see it.
Status codes are grouped by their first digit:
1xx - Informational: Request received, continuing process 2xx - Success: Request succeeded 3xx - Redirection: Further action needed 4xx - Client Error: You made a mistake 5xx - Server Error: Server made a mistake
Everything worked! Request succeeded. This is what you want to see for successful GET requests.
New resource created successfully. Used after POST requests when creating new records.
Success, but no data to return. Common for DELETE requests where you just need confirmation of deletion.
Your request was malformed or invalid. Check your request body and parameters.
No related topics found.
You need to log in. No authentication provided or invalid token. User needs to authenticate.
You are logged in but do not have permission. User authenticated but not authorized for this resource.
The resource you requested does not exist. Check your URL and resource ID.
Something went wrong on the server. Not your fault. Server has a bug or encountered an unexpected condition.
Resource moved to new URL forever. Update your bookmarks and links.
Resource temporarily at different URL. Original URL still valid.
Resource has not changed since last request. Use cached version for better performance.
Check response status and handle different codes appropriately. You can check specific status codes or use response.ok for any 2xx success code.
GET (retrieve data):
POST (create data):
PUT/PATCH (update data):
DELETE:
When building APIs, always return appropriate status codes. This helps clients understand what happened and handle responses correctly.
409 Conflict: Resource already exists (duplicate email or username)
429 Too Many Requests: Rate limit exceeded, slow down
503 Service Unavailable: Server temporarily down for maintenance
422 Unprocessable Entity: Syntax correct but semantically wrong
2xx: Success - celebrate! Everything worked as expected. 3xx: Redirect - go somewhere else to find what you need. 4xx: Your fault - fix your request before trying again. 5xx: Server fault - nothing you can do except report it.
Browser DevTools Network tab shows status codes with color coding:
Click on any request to see full details including headers and response body.
HTTP status codes communicate what happened with your request. Learn the common ones (200, 400, 401, 404, 500) and you can debug API issues quickly.
Always check status codes when making HTTP requests. They tell you exactly what went wrong and how to fix it.