Skip to content
Latchkey

curl -v / --verbose: Debug Requests in CI

When a request fails for no obvious reason, -v shows exactly what was sent and returned.

Verbose output is the first tool to reach for when an API call misbehaves: it exposes headers, redirects, and the TLS handshake.

What it does

-v / --verbose makes curl print connection details, the request headers it sends (lines starting with >), the response headers it receives (lines starting with <), and TLS handshake info, all to stderr. --trace and --trace-ascii dump the full request and response bytes to a file for deeper inspection. The response body still goes to stdout.

Common usage

Terminal
curl -v https://api.example.com/x
curl -sS -v -o /dev/null https://api.example.com/x   # headers only
curl --trace-ascii trace.log https://api.example.com/x

Flags

FlagWhat it does
-v / --verbosePrint request/response headers and TLS info to stderr
--trace <file>Dump full request/response bytes to a file
--trace-ascii <file>Like --trace but ASCII, easier to read
--trace-timeAdd timestamps to trace output
-i / --includeInclude response headers in the body output

In CI

Use -v to debug a flaky call, but be careful: trace output can include sensitive request data. Newer curl redacts the Authorization header in -v, but --trace does not redact bodies, so do not leave tracing on in logs that persist. Remove -v once the issue is understood.

Common errors in CI

In -v output, a line like < HTTP/2 403 pins the failing status, and the > Authorization line (redacted in newer curl) confirms whether auth was sent. SSL handshake lines reveal cert problems before the body ever arrives.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →