HTTP Status Codes Reference
Frequently Asked Questions
What is the difference between a 401 and a 403 HTTP status code?
A 401 Unauthorized means the request lacks valid authentication credentials — the user needs to log in or provide an API key. A 403 Forbidden means the user is authenticated but does not have permission to access the resource. Re-authenticating fixes 401 but will not resolve a 403 error.
Should I use a 301 or 302 redirect when moving a page?
Use 301 Moved Permanently for all permanent URL changes — it transfers link equity to the new URL and tells search engines to update their index. Use 302 Found only for genuinely temporary redirects such as maintenance pages or short-term A/B tests. Using 302 for permanent moves can cause SEO ranking loss.
What causes a 502 Bad Gateway error and how do I fix it?
A 502 Bad Gateway occurs when a proxy or load balancer receives an invalid or no response from an upstream server. Common causes include a crashed application server, deployment issues, or a misconfigured reverse proxy. Check upstream server health, review error logs, and verify that backend services are running and reachable.
What is the correct HTTP status code to return when creating a new resource via a POST request?
The correct code is 201 Created, not 200 OK. A 201 response signals to API consumers that a new resource was successfully created. Best practice is to include a Location header pointing to the newly created resource's URL, and optionally return the resource in the response body for convenience.
How does HTTP 304 Not Modified improve website performance?
When a browser requests a cached resource, it sends conditional headers like If-None-Match or If-Modified-Since. If the resource is unchanged, the server returns 304 with no body, saving bandwidth. The browser uses its cached copy instead of downloading again. This dramatically reduces load times and server costs for returning visitors.
Recommended
Related Tools
Base64 Encoder / Decoder
Encode and decode Base64 text instantly, convert files to Base64, create data URLs, and use URL-safe Base64 when needed.
URL Encoder / Decoder
Encode plain text to URL-safe format or decode percent-encoded URLs back to readable text instantly.
JWT Decoder
Decode and inspect JWT tokens instantly. View header, payload claims, and expiry — no server needed.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes. Compare and verify hashes.
JSON Formatter
Format, validate, minify and analyze JSON with syntax highlighting and stats.