Skip to main content
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
OKMove/CacheFix RequesRetryableHTTP Stat…2xx Succe…3xx Redir…4xx Clien…5xx Serve…
HUBHTTP Status
4 links
Quick 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/308 permanent redirect, 302/307 temporary, 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 401 from 403: Return 401 when authentication is missing or expired (triggering token refresh or login) and 403 when an authenticated user lacks permission.
  • Drive retry and alerting logic from status classes: Never blind-retry 4xx (except 429 honoring Retry-After); retry transient 502/503/504 with exponential backoff and page on-call engineers on 5xx spikes.
  • 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 401 and backing off on 429/503.
  • SEO & CDN caching: Preserving search equity with 301 redirects and saving bandwidth with 304 Not Modified.