Web DevAPIs & NetworkingDiagramBeginner
HTTP Status Codes
KO: HTTP 상태 코드·EN: HTTP Status Codes·JA: HTTPステータスコード
Standardized three-digit codes (1xx–5xx) returned by HTTP servers to communicate request success, redirection, client errors, or server failures
Table of Contents
Structure Diagram
Core HTTP Response Status Code ClassesTap a node
HUBHTTP Status
4 linksQuick Answer
What is HTTP Status Codes?
Standardized three-digit codes (1xx–5xx) returned by HTTP servers to communicate request success, redirection, client errors, or server failures. It is a core concept in APIs & Networking within Web Dev.
Core Principles
HTTP status codes are three-digit integers that let browsers, CDNs, load balancers, and SDKs understand the outcome of a request without parsing the response body:
- 2xx (Success):
200 OK,201 Created,202 Accepted(async queued),204 No Content. - 3xx (Redirection & Caching):
301/308permanent redirect,302/307temporary,304 Not Modified. - 4xx (Client Error):
400 Bad Request,401 Unauthorized(missing/expired auth),403 Forbidden(authenticated but lacks permission),404 Not Found,409 Conflict,422 Unprocessable Content,429 Too Many Requests. - 5xx (Server Error):
500 Internal Server Error,502 Bad Gateway,503 Service Unavailable,504 Gateway Timeout.
Practical Takeaways
- Distinguish
401from403: Return401when authentication is missing or expired (triggering token refresh or login) and403when an authenticated user lacks permission. - Drive retry and alerting logic from status classes: Never blind-retry
4xx(except429honoringRetry-After); retry transient502/503/504with exponential backoff and page on-call engineers on5xxspikes. - Never wrap errors in
200 OK: Returning{ ok: false }with HTTP 200 breaks APM error tracking, HTTP caching, and client retry libraries.
Notable Examples
- HTTP client interceptors: Automatically refreshing tokens on
401and backing off on429/503. - SEO & CDN caching: Preserving search equity with
301redirects and saving bandwidth with304 Not Modified.