Opscraft
HTTP & status codes · Lesson 2 of 9 · 3 min read

The five classes, 1xx and 2xx

Classes in ten seconds

Class Meaning Who's at fault (roughly)
1xx Informational — keep going —
2xx Success —
3xx Redirection — go elsewhere / use cache —
4xx Client error — the request is wrong or not allowed Client (or auth/config)
5xx Server error — the server or an upstream failed Server side
Enlarge diagram1xxkeep going2xxsuccess3xxgo elsewhere4xxclient error5xxserver error101 WebSocket200, 201, 204301, 302, 304400, 401, 403, 404, 429500, 502, 503, 504
Figure 1. The first digit tells you the story. 4xx usually means fix the request; 5xx means something on the server side failed.
Swipe sideways to see all of it, or tap to open it full screen.

1xx informational

  • 100 Continue — the client sent headers with Expect: 100-continue (common for large uploads); the server says "go ahead, send the body".
  • 101 Switching Protocols — upgrade accepted, e.g. to WebSocket (Upgrade: websocket). Proxies and load balancers must support it (ALB does; some proxies need explicit config).
  • 103 Early Hints — preload hints before the final response.

2xx success

Code Meaning Typical use
200 OK Success with a body GET, most responses
201 Created A resource was created POST create — include Location: /orders/43 and/or the body
202 Accepted Accepted for asynchronous processing, not done yet Long jobs: return a job ID/status URL instead of holding the connection
204 No Content Success, no body DELETE, PUT/PATCH where nothing needs returning
206 Partial Content Part of a resource (Range requests) Video streaming, resumable downloads

Watch out: "a 200 can still be an error". Some APIs return 200 with {"error": "..."} in the body. Monitoring that only counts 5xx misses these failures — use proper status codes in your services, and for third-party APIs monitor payloads or synthetic checks.

Enlarge diagramClientAPIWorkerqueue + jobPOST /reportsenqueue job 913202 Accepted · Location: /jobs/913GET /jobs/913200 · status: runningjob finishedGET /jobs/913200 · status: done, download link
Figure 2. For long jobs, do not hold the connection open: accept the work with 202 and let the client check a status URL.
Swipe sideways to see all of it, or tap to open it full screen.