HTTP Common Errors and Debugging

Common HTTP status code comparisons, cURL debugging recipes, and troubleshooting patterns.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

cURL Debugging Patterns

Quick commands for checking status codes and redirects.

Print only the status code

Useful for scripts and health checks.

bashANYcurlhttpdebugginghealthcheck
bash
curl -s -o /dev/null -w '%{http_code}
' https://example.com/health

A compact pattern for extracting the final status code in shell scripts.

Print redirect target

Show the redirect location without fully following it.

bashANYcurlredirectlocation
bash
curl -s -o /dev/null -D - https://example.com | grep -i '^location:'

Useful for checking 301, 302, 307, and 308 behavior.

Show timing data

Inspect total time and status code together.

bashANYcurltiminghttp
bash
curl -s -o /dev/null -w 'code=%{http_code} time=%{time_total}
' https://example.com

Helpful when distinguishing slow 200s from outright 5xx failures.

Send JSON and inspect response

Test common API validation and auth failures.

bashANYcurlapijson
bash
curl -i -X POST https://example.com/api/users -H 'Content-Type: application/json' -d '{"name":"Ada"}'

A good baseline for reproducing 400, 401, 403, 415, 422, and 429 responses.

Common Web Error Scenarios

Frequent status-code situations in web apps and APIs.

401 vs 403

Authentication versus authorization.

textANYauth401403
text
401 = not authenticated / invalid credentials
403 = authenticated but forbidden

A very common distinction in API and admin-console debugging. `401` often includes `WWW-Authenticate`; `403` is about permission refusal.

404 vs 410

Missing resource versus intentionally removed resource.

textANY404410http
text
404 = not found
410 = gone permanently

Use `410` when you want to communicate that the resource was intentionally removed and is not coming back.

301 vs 302 vs 307 vs 308

Choose the right redirect semantics.

textANYredirects301302307
text
301 = permanent
302 = temporary
307 = temporary, preserve method
308 = permanent, preserve method

`307` and `308` are often better for APIs when method preservation matters.

502 vs 503 vs 504

Gateway and availability failures.

textANY5xxproxygateway
text
502 = bad upstream response
503 = service unavailable / overloaded / maintenance
504 = upstream timeout

These are some of the most common proxy and load-balancer errors.

Cache validation codes

Conditional request and cache-related statuses.

textANYcacheetagconditional-request
text
304 Not Modified
412 Precondition Failed

Conditional requests with ETag or date validators often center around `304` and `412`.

Recommended next

No recommendations yet.