HTTP Status Code Reference
Every HTTP status code explained — with real-world use cases, when to use them, and what they mean in REST APIs. Filter by category (1xx–5xx) or search by code number, name, or keyword.
Frequently Asked Questions
What are HTTP status codes and why do they matter?▼
HTTP status codes are 3-digit numbers a server returns with every response to indicate the outcome of a request. They're grouped into 5 classes: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error), and 5xx (server error). Understanding them is essential for debugging APIs, building error handling, and interpreting server logs.
What's the difference between 401 Unauthorized and 403 Forbidden?▼
401 Unauthorized means the server doesn't know who you are — authentication is missing or invalid. 403 Forbidden means the server knows who you are but you don't have permission. Use 401 when credentials are absent or wrong; use 403 when the user is authenticated but lacks access rights.
When should I use 301 vs 302 redirects?▼
301 Moved Permanently tells browsers and search engines to permanently update their records — SEO equity passes and the redirect is cached. 302 Found is temporary, so the original URL is preserved and not cached. Use 301 for permanent URL changes and domain migrations; use 302 for login flows, A/B testing, and temporary redirects.
What does 429 Too Many Requests mean?▼
429 indicates rate limiting — the client has exceeded the allowed request rate. Servers should include a Retry-After header showing when to retry. Clients should implement exponential backoff with jitter. This is the standard way to protect APIs from abuse without returning a 503.
When should a REST API return 422 vs 400?▼
400 Bad Request is for syntactically malformed requests (invalid JSON, missing Content-Type header). 422 Unprocessable Entity is for syntactically valid but semantically invalid input (correct JSON structure, but a field fails validation like 'age' being -5). Use 422 for form/field validation errors in modern APIs.
What is the difference between 404 and 410?▼
404 Not Found means the resource doesn't exist or you're not revealing its existence. 410 Gone means the resource previously existed but has been permanently deleted — this signals crawlers to deindex the URL and removes it from search results faster. Use 410 when you deliberately retire URLs; 404 is fine when you don't track deletions.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
Webhook Tester
Generate realistic webhook test payloads for GitHub, Stripe, Slack, and custom services. Get a curl command to send the payload to your local endpoint. Inspect headers, payload size, and content-type.
Open free tool →
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
API Request Builder
Build and test HTTP requests visually with any method, headers, and body. Generate cURL commands instantly. Free online API testing tool with Pro unlimited access. No signup required.
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Webhook Testing: How to Debug, Inspect, and Replay Webhooks in 2026
Complete guide to webhook testing. Covers local tunneling, replay tools, signature verification, retry handling, and the best practices for testing webhooks without production data.
Complete HTTP Status Codes Reference for REST API Devs
The complete HTTP status codes reference for REST API developers. Every 1xx, 2xx, 3xx, 4xx, and 5xx code explained with real-world API examples and best practices.
GraphQL Federation vs REST Microservices: Which Architecture in 2026?
Compare GraphQL Federation vs REST microservices — Apollo Federation, schema stitching, performance, team scaling, migration paths, and when to choose each in 2026.
tRPC vs GraphQL vs REST: Type-Safe APIs in 2026
Compare tRPC, GraphQL, and REST for building type-safe APIs in 2026. Covers DX, performance, bundle size, schema management, and when to use each approach.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →