Cheat sheet

HTTP — essential codes and headers

HTTP reference for methods, status codes, redirects, headers, caching, CORS, security and TLS/web troubleshooting.

⌚ About 2 min read
View my favorites
WebBeginner to advanced8 sections · 32 reference points

HTTP reference for methods, status codes, redirects, headers, caching, CORS, security and TLS/web troubleshooting.

HTTP methods

GET
Lire une ressource

Should ideally be safe/read-only from the client perspective.

HEAD
Headers sans corps

Useful for status, redirects and caching without body.

POST
Soumettre/créer selon API

Often non-idempotent; repeating may create multiple operations.

PUT/PATCH/DELETE
Modification ou suppression API

Semantics and authorization depend on the API.

2xx / 3xx status codes

200
OK

Standard successful response.

204
No Content

Success with no response body.

301
Moved Permanently

Cacheable permanent redirect.

302/307/308
Redirections

307/308 explicitly preserve method; inspect the actual chain.

4xx status codes

400
Bad Request

Malformed or invalid request.

401
Unauthorized

Missing/invalid authentication; often with WWW-Authenticate.

403
Forbidden

Server understands but refuses access.

404/429
Not Found / Too Many Requests

429 may include Retry-After; 404 can sometimes hide forbidden resources.

5xx status codes

500
Internal Server Error

Check application/runtime logs at the same timestamp.

502
Bad Gateway

Gateway/proxy received an invalid upstream response.

503
Service Unavailable

Maintenance, overload or unavailable upstream.

504
Gateway Timeout

Upstream exceeded proxy timeout.

Request/response headers

Host
Name d’hôte demandé

Critical for virtual hosts and reverse proxies.

Content-Type
Type MIME du corps

Wrong MIME type can break APIs, browsers or downloads.

Authorization
Bearer / Basic / autre

Do not log tokens/secrets in plain text.

Set-Cookie
Cookie + attributs

Inspect Secure, HttpOnly, SameSite, Domain and Path.

Caching & compression

Cache-Control
max-age, no-cache, no-store, private...

no-cache allows storage with revalidation; no-store forbids storage.

ETag
Validateur de représentation

Can enable 304 Not Modified after revalidation.

Last-Modified
Date de dernière modification

Used with If-Modified-Since.

Content-Encoding
gzip / br

Check proxy/CDN

Security & CORS

HSTS
Strict-Transport-Security

Use includeSubDomains/preload only after validating all HTTPS subdomains.

CSP
Content-Security-Policy

Roll out gradually; strict CSP can break scripts, fonts or embeds.

nosniff
X-Content-Type-Options: nosniff

Reduces unwanted MIME sniffing.

CORS
Access-Control-Allow-Origin et associés

CORS is a browser policy, not server authentication.

Diagnostic commands

curl headers
curl -I https://exemple.fr

Shows status and headers.

Redirect chain
curl -IL https://exemple.fr

Follows redirects to detect loops or unexpected targets.

Verbose TLS/HTTP
curl -vI https://exemple.fr

Shows DNS, connection, TLS and headers; output may contain sensitive data.

PowerShell HEAD
Invoke-WebRequest https://exemple.fr -Method Head

Native Windows alternative for status and headers.

Key points

  • Status code alone is not enough; keep URL, method, timestamp and relevant headers.
  • Redirects may come from CDN, reverse proxy, web server or application.
  • Do not use curl -k as proof of TLS security; it disables certificate validation.
  • CSP, HSTS and CORS must be tested against the real application.
← All cheat sheets
♡ 0