Show response headers and body
#-i includes response headers. -D writes headers separately; -o chooses a body output file. -sS hides progress while retaining errors.
Fragment
-v emits connection and request details, which may contain credentials.
Reference
Decode requests, responses, browser rules and network diagnostics.
Wire examples use HTTP/1.1 notation; HTTP/2 and HTTP/3 encode it differently. Commands use a Unix-like shell and illustrative example.test hosts. Browser security behavior is labeled separately from HTTP and command-line clients.
-i includes response headers. -D writes headers separately; -o chooses a body output file. -sS hides progress while retaining errors.
Fragment
-v emits connection and request details, which may contain credentials.
-I sends HEAD and displays headers. To inspect headers from a real GET without saving its body, use -D - with -o /dev/null.
Fragment
A server can handle HEAD and GET differently; choose the method you intend to diagnose.
--data-binary sends the supplied bytes, selecting POST by default. --get with --data-urlencode constructs a GET query.
Fragment
By default, curl can exit successfully after receiving HTTP 404 or 500. --fail-with-body makes HTTP errors fail while retaining the body. --connect-timeout and --max-time bound different stages.
Fragment
--fail-with-body requires curl 7.76+. Authentication cases have documented caveats.
-L follows redirects. -w can print the final status and effective URL; -o /dev/null discards body bytes.
Fragment
Redirect options and HTTP method affect replay behavior. Avoid --location-trusted unless credential forwarding is explicitly intended.
Fetch rejects for network-level failures and aborts, not ordinary 4xx/5xx statuses. response.ok covers 200–299. Read the body in its expected format.
Fragment
A body stream is normally consumed once. Runtime validation is still needed for parsed JSON.
AbortController signals cancellation to Fetch. Aborting client work does not prove that server-side processing was rolled back.
Fragment