πŸ‹
Menu
How-To Beginner 1 min read 296 words

HTTP Status Codes: A Developer's Quick Reference

Choosing the right HTTP status code communicates your API's intent clearly. Learn when to use each status code family and the most important codes in each range.

The Five Families

HTTP status codes are grouped into five families: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error), and 5xx (server error). Each family communicates a different class of response.

2xx Success Codes

200 OK β€” the standard success response for GET and PUT requests. 201 Created β€” return this for successful POST requests that create a resource, with a Location header pointing to the new resource. 204 No Content β€” use for successful DELETE requests or updates that return no body. 202 Accepted β€” the request is queued for processing but not yet complete (asynchronous operations).

3xx Redirection Codes

301 Moved Permanently β€” the resource has a new URL permanently; search engines transfer ranking. 302 Found β€” temporary redirect; search engines keep indexing the original URL. 304 Not Modified β€” the resource hasn't changed since the client's last request (used with caching headers).

4xx Client Error Codes

400 Bad Request β€” the request body or parameters are malformed. Include a descriptive error message. 401 Unauthorized β€” authentication is required or the provided credentials are invalid. 403 Forbidden β€” the authenticated user doesn't have permission. 404 Not Found β€” the resource doesn't exist. 409 Conflict β€” the request conflicts with the current state (e.g., duplicate email). 422 Unprocessable Entity β€” the request is syntactically correct but semantically invalid (validation errors). 429 Too Many Requests β€” rate limit exceeded; include a Retry-After header.

5xx Server Error Codes

500 Internal Server Error β€” an unexpected error occurred; log the details server-side. 502 Bad Gateway β€” the server acting as proxy received an invalid response from upstream. 503 Service Unavailable β€” the server is temporarily overloaded or in maintenance; include Retry-After. 504 Gateway Timeout β€” the upstream server didn't respond in time.

κ΄€λ ¨ 도ꡬ

κ΄€λ ¨ 포맷

κ΄€λ ¨ κ°€μ΄λ“œ