# HTTP Status Code Reference — Code Reference, Topic Guides, Framework Guides For the full tool, see: [https://capytoolkit.com/tools/network/http-status/](https://capytoolkit.com/tools/network/http-status/) ## HTTP Status Code Reference [404 Not Found](https://capytoolkit.com/tools/network/http-status/reference/#404-not-found): HTTP 404 Not Found means the server found no resource at the requested URI. Causes, resolution steps, and when to return 404 vs 410 in API design. [500 Internal Server Error](https://capytoolkit.com/tools/network/http-status/reference/#500-internal-server-error): HTTP 500 Internal Server Error means the server encountered an unexpected failure. Causes, debugging steps, and when to use 500 vs 502 vs 503. [401 Unauthorized](https://capytoolkit.com/tools/network/http-status/reference/#401-unauthorized): HTTP 401 Unauthorized means the request lacks valid credentials. How it differs from 403, how WWW-Authenticate works, and debugging auth flows. [403 Forbidden](https://capytoolkit.com/tools/network/http-status/reference/#403-forbidden): HTTP 403 Forbidden means the server understood the request but refuses to fulfill it. When to return 403 vs 401 vs 404, and role-based access patterns. [429 Too Many Requests](https://capytoolkit.com/tools/network/http-status/reference/#429-too-many-requests): HTTP 429 Too Many Requests signals a rate limit has been hit. Retry-After header, token bucket vs leaky bucket, and client-side handling strategies. [503 Service Unavailable](https://capytoolkit.com/tools/network/http-status/reference/#503-service-unavailable): HTTP 503 Service Unavailable means the server is temporarily unable to handle the request. Retry-After header, maintenance patterns, and 503 vs 500 vs 502. [502 Bad Gateway](https://capytoolkit.com/tools/network/http-status/reference/#502-bad-gateway): HTTP 502 Bad Gateway indicates an upstream server returned an invalid response. Causes, reverse proxy debugging, and 502 vs 503 vs 504 explained. [200 OK](https://capytoolkit.com/tools/network/http-status/reference/#200-ok): HTTP 200 OK is the baseline success response. When to use 200 vs 201 vs 204, caching behavior, and common anti-patterns like returning 200 for errors. [201 Created](https://capytoolkit.com/tools/network/http-status/reference/#201-created): HTTP 201 Created confirms a new resource was successfully created. How to use the Location header, POST vs PUT creation patterns, and 201 vs 200. [304 Not Modified](https://capytoolkit.com/tools/network/http-status/reference/#304-not-modified): HTTP 304 Not Modified tells the client its cached copy is still valid. How ETags, If-None-Match, and conditional requests work in the browser and API caching. [422 Unprocessable Content](https://capytoolkit.com/tools/network/http-status/reference/#422-unprocessable-entity): HTTP 422 Unprocessable Content means the request is syntactically valid but semantically wrong. When to use 422 vs 400, validation error body format, and API design. ## Topic Guides [HTTP Status Codes in REST API Design](https://capytoolkit.com/tools/network/http-status/http-status-codes-api-design/): How to choose the right HTTP status codes for REST APIs. 2xx, 4xx, 5xx selection rules, validation errors, and consistent error response bodies. [Pick the Right 4xx Code for Your API Response](https://capytoolkit.com/tools/network/http-status/http-4xx-client-errors/): Decide which 4xx code fits your API scenario: 400 vs 422 for validation, 401 vs 403 for access, 404 vs 410 for deleted resources, and where 409 and 429 fit in. [Identify Your 5xx Error's Fault Tier](https://capytoolkit.com/tools/network/http-status/http-5xx-server-errors/): Work through the decision tree above to identify which layer produced your 500, 502, 503, or 504, then route debugging to the right team and set up rate-based alerts that catch the next one. [HTTP Redirect Codes: 301 vs 302 vs 307 vs 308](https://capytoolkit.com/tools/network/http-status/http-redirect-codes/): HTTP redirect codes compared: permanent vs temporary, method preservation, SEO link equity transfer, and when to use 301, 302, 307, or 308. [HTTP Status Codes and SEO Impact](https://capytoolkit.com/tools/network/http-status/http-status-codes-seo/): How HTTP status codes affect search engine crawling and indexing. 200, 301, 302, 404, 410, and 503 explained for SEO: crawl budget, link equity, and indexing signals. [Debug Your Cloudflare Error With the Ray ID](https://capytoolkit.com/tools/network/http-status/cloudflare-error-codes/): Find the Ray ID on your Cloudflare 520 through 527 error page, then use it to trace exactly what your origin server did wrong and how that differs from a standard 502 or 504. [Nginx Custom Status Codes](https://capytoolkit.com/tools/network/http-status/nginx-status-codes/): Nginx non-standard status codes explained: 444 (connection drop), 494 (header too large), 495 (SSL error), 496 (no cert), 499 (client disconnect). Reading nginx logs. [Designing Consistent API Error Responses](https://capytoolkit.com/tools/network/http-status/api-error-response-design/): How to design consistent API error response bodies. Machine-readable codes, RFC 7807 Problem Details, field-level validation errors, and correlation IDs. [HTTP Caching and Status Codes](https://capytoolkit.com/tools/network/http-status/http-caching-status-codes/): How HTTP status codes interact with caching. Which codes are cacheable by default (RFC 9110), Cache-Control with status codes, and the 304 conditional request flow. ## HTTP Status Code Reference: Code Examples [HTTP Status Codes in Express.js](https://capytoolkit.com/tools/network/http-status/code-examples/#express-status-codes): Set HTTP status codes in Express.js with res.status(). Handle 404, 500, 422, and custom error middleware. Code examples for REST APIs. [HTTP Status Codes in Django REST Framework](https://capytoolkit.com/tools/network/http-status/code-examples/#django-rest-framework-status): Set HTTP status codes in Django REST Framework with status constants, Response(), raise NotFound(), and custom exception handlers. Code examples included. [HTTP Status Codes in FastAPI](https://capytoolkit.com/tools/network/http-status/code-examples/#fastapi-status-codes): Set HTTP status codes in FastAPI with HTTPException, status constants, and Response(). Examples for 201, 204, 404, 422 and custom error handling. [HTTP Status Codes in Next.js API Routes](https://capytoolkit.com/tools/network/http-status/code-examples/#nextjs-api-routes-status): Set HTTP status codes in Next.js API routes. Pages Router uses res.status(), App Router uses NextResponse. Examples for 201, 404, 422 in both routers. [HTTP Status Codes with the Fetch API](https://capytoolkit.com/tools/network/http-status/code-examples/#fetch-api-error-handling): Handle HTTP status codes with the Fetch API. response.ok, response.status, and building a fetch wrapper that throws on 4xx and 5xx responses. [HTTP Status Codes in Spring Boot](https://capytoolkit.com/tools/network/http-status/code-examples/#spring-boot-status-codes): Set HTTP status codes in Spring Boot with ResponseEntity, @ResponseStatus, and @ControllerAdvice. Examples for 201, 204, 404, and global exception handling. [HTTP Status Codes with Python requests](https://capytoolkit.com/tools/network/http-status/code-examples/#python-requests-status): Read HTTP status codes in Python requests with response.status_code, response.raise_for_status(), and response.ok. Error handling examples for REST API clients.