HTTP Status Codes Complete Guide

Master HTTP status codes for API development, debugging, and testing with comprehensive guides and cURL examples

200
OK
The request has succeeded. The meaning of success depends on the HTTP method used.
curl -X GET "https://api.example.com/users"
400
Bad Request
The server cannot process the request due to client error (malformed request syntax, invalid request).
curl -X POST "https://api.example.com/users" -d "invalid-json"
401
Unauthorized
The request requires user authentication. The client must authenticate itself to get the requested response.
curl -X GET "https://api.example.com/private"
404
Not Found
The server cannot find the requested resource. This status code is commonly used when the URL is not recognized.
curl -X GET "https://api.example.com/nonexistent"
500
Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
curl -X POST "https://api.example.com/users" -d '{"data":"valid"}'
502
Bad Gateway
The server acting as a gateway received an invalid response from the upstream server.
curl -X GET "https://api.example.com/data" --max-time 30
503
Service Unavailable
The server is currently unavailable (overloaded or down for maintenance).
curl -X GET "https://api.example.com/status" --retry 3