HTTP Commands
HTTP semantics, methods, headers and status codes.All HTTP pages
- curl -I vs -i vs -v: show HTTP response headersShow HTTP response headers with curl: -I sends HEAD, -i prints the headers and body, -D - dumps headers for any method, -v adds request and TLS details.
- curl follow redirects and show the redirect chain (curl -L)Follow HTTP redirects with curl -L, print every hop with its status and Location header, limit them with --max-redirs, and see how POST changes on 301-303.
- curl get only the HTTP status code: curl -s -o /dev/null -w '%{http_code}'Print only the HTTP status code with curl -s -o /dev/null -w '%{http_code}', use it in scripts and health checks, and learn why curl sometimes prints 000.
- Test ETag caching with curl: send If-None-Match and get 304 Not ModifiedTest conditional GET with curl: copy the ETag, send it in If-None-Match and expect 304 Not Modified, or let curl do it with --etag-save and --etag-compare.