HTTP Status Codes reference data

Complete reference of HTTP response status codes.

  • 13 datasets
  • JSON · YAML · TOON
  • CC0 — public domain

Topic guide

What HTTP Status Codes covers

This category is the reference for how HTTP clients and servers talk: the status codes that summarize a response, the methods that say what a request wants, the headers that carry metadata, and the mechanisms layered on top (authentication, caching, content negotiation, CORS and redirects). The codes and methods are defined by IETF specifications, chiefly RFC 9110, so their meaning is stable, but real servers and APIs bend them. The practical skill is to pick the most specific correct code and to know which behaviors (caching, retries, redirects) a client will infer from it.

Key ideas

Status code class
The first digit gives the class: 1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error.
Safe and idempotent methods
Safe methods (GET, HEAD, OPTIONS) do not change server state. Idempotent methods (those plus PUT and DELETE) have the same effect when repeated, which makes retries safe.
401 vs 403
401 means authentication is missing or invalid; 403 means the client is authenticated but not allowed.
Redirect semantics
301 and 308 are permanent, 302 and 307 temporary. 307 and 308 preserve the request method; 301 and 302 historically allow clients to change POST to GET.
Cache validators
ETag and Last-Modified let a client ask whether its stored copy is still valid and receive 304 Not Modified instead of the full body.
Content negotiation
The client states preferences with Accept headers and the server chooses a representation, signaling dependence with Vary.
CORS
A browser mechanism that lets a server permit cross-origin requests with Access-Control headers, often after a preflight OPTIONS request.

Common pitfalls

  • Returning 200 with an error message in the body. Clients, caches and monitors rely on the status code.
  • Using 404 and 403 inconsistently to hide or reveal that a resource exists; decide the policy and apply it uniformly.
  • Redirecting with 301 when a temporary move is intended. Browsers and search engines cache permanent redirects aggressively.
  • Setting Access-Control-Allow-Origin to * on responses that use credentials; browsers reject that combination.

Using it from an agent

  • Retry only idempotent requests and 429, 502, 503 and 504 responses, honoring Retry-After and using exponential backoff with jitter.
  • When asked what a code means, give the code, the name, the typical cause and the action the client should take.
  • Quote RFC 9110 for definitions of methods and status codes and RFC 9111 for caching.

Start with: Complete HTTP Status Codes Reference · HTTP Methods Reference

Datasets in HTTP Status Codes

Fetch this category

One request returns the category with all of its dataset summaries. Append ?format=yaml or ?format=toon for the other encodings.

GET https://yjtoon.com/api/category/http-status-codes?format=json

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets