Request basics
Inspect a request with verbose output
Use verbose mode to separate DNS, connection, TLS, request headers, and response headers.
A single curl command does a lot of work you never see. A DNS lookup. A TCP connection. A TLS handshake. Then the request, then the response. When something breaks, you need to know which of those steps failed. Verbose mode shows you all of them.
Inspect one HTTPS request:
curl -v https://example.org/ -o /dev/null
-o /dev/null throws the body away. Everything left on screen is diagnostics.
Read the prefixes
Every verbose line starts with a marker that tells you who is talking:
>is a header curl sent<is a header curl received*is curl talking about itself: name resolution, TLS, connection events
A trimmed trace looks like this:
* Host example.org:443 was resolved.
* Connected to example.org port 443
* SSL connection using TLSv1.3
> GET / HTTP/2
> Host: example.org
> User-Agent: curl/8.7.1
< HTTP/2 200
< content-type: text/html
Follow the order. Resolution, connection, TLS, request, response. That sequence is your debugging map.
If the trace stops in the * lines, the problem is network or TLS. Your request never reached the server. If you see your > request followed by an unexpected < status, the server got your request and disagreed with it. Two very different problems, and the trace tells them apart in seconds.
Use it to answer real questions
Verbose output settles arguments that guessing can’t.
Did curl send the header I added? Look for it in the > lines. Which HTTP version did we negotiate? It’s in the * and > lines. Is curl reusing the connection between two requests? Put two URLs in one command and look for a Re-using existing connection line.
I reach for -v before I reach for any other debugging tool. It’s cheap, and it removes the guessing.
Redact before you share
Verbose output prints every header exactly as sent. That includes Authorization headers, cookies, and anything else you’d rather keep private.
Before you paste a trace into a ticket, a chat, or a blog post, remove those values. The whole point of -v is that nothing is hidden. That includes the things that should stay hidden from other people.
Try this on your own: run curl -v against a site you use and find the three sections in the output. Then add --header 'X-Test: hello' and confirm the header shows up in the > lines.
Lesson completed