Quick verdict: Use curl -I <url> to send a HEAD request and get back only the response headers — no body. It's the right tool for checking file sizes before download, tracing redirect chains, validating Content-Type, or doing fast liveness checks. -I beats -X HEAD in every case because -X HEAD can hang waiting for a body that never comes.
This guide covers what HEAD actually does at the protocol level, the -I vs -X HEAD distinction that trips up a lot of developers, eight copy-paste examples for common tasks, and how to send HEAD requests through a proxy for scraping or geo-targeted checks.
HEAD is one of the nine standard HTTP methods defined in RFC 9110. It's identical to GET except the server returns only the response headers — not the body. The same caching, redirects, and authentication rules apply.
Two practical implications:
curl -I vs curl -X HEADBoth look like they do the same thing. They don't.
| Flag | What it does | Pitfalls |
|---|---|---|
-I (uppercase i) | Sends HEAD, configures cURL to expect headers only. Shorthand for --head. | None — this is the canonical form. |
-X HEAD | Overrides the request method to HEAD but cURL still expects a body. | Can hang waiting for a body that doesn't come back. Use only when combining with other options that conflict with -I. |
Rule of thumb: always use -I for HEAD. Reserve -X HEAD for the rare case where you need to override an explicit GET set by another flag.
curl -I https://example.com
HTTP/2 200
content-type: text/html; charset=UTF-8
content-length: 1256
last-modified: Mon, 13 Apr 2026 09:00:34 GMT
cache-control: max-age=300
server: ECS
curl -ILs https://bit.ly/example
# -L follows redirects
# -s silences progress
# -I prints headers
curl -ILs https://releases.ubuntu.com/24.04/ubuntu-24.04-server-amd64.iso | grep -i content-length
content-length: 2516582400
That's 2.5 GB — useful to know before kicking off a `wget -c` (see our curl vs wget guide for the full comparison).
curl -Is https://example.com -o /dev/null -w '%{http_code}
'
200
Drops everything except the status code — perfect for shell scripts.
curl -I -x http://USER:[email protected]:8080 https://example.com
Use a static residential proxy when you need consistent geo-targeting for the HEAD probe (e.g., checking how a CDN serves different regions).
curl -ILs https://example.com/file | grep -i content-type
content-type: application/pdf
curl -ILs --max-redirs 10 https://t.co/short | grep -E '^HTTP|^location' | head -20
curl -I -H 'User-Agent: Mozilla/5.0' -H 'Accept-Language: en-US' https://example.com
For scraping workflows, you often want to use HEAD to filter URLs before doing full GETs — e.g., skip pages that redirect to a 404 or have wrong Content-Type. Through a proxy, all the same flags apply:
curl -I -x http://USER:[email protected]:8080 -H 'User-Agent: ScrapeBot/1.0' --max-time 10 https://target-site.com/listing/12345
For high-volume HEAD scanning across thousands of URLs, use a rotating residential proxy so each request appears to come from a different IP — most servers don't rate-limit HEAD as aggressively as GET, but it still helps. Verify your proxy is routing properly first with our proxy checker.
| Method | Returns body? | Use when |
|---|---|---|
| HEAD | No | Liveness check, file-size lookup, redirect tracing, Content-Type discovery |
| GET | Yes | Fetch content. Required when HEAD is not supported (rare, but happens) |
| OPTIONS | No | CORS preflight, discovering allowed methods on an endpoint |
curl -s -o /dev/null -w '%{http_code} %{size_download}' <url> to send GET but discard the body.-X HEAD: Switch to -I. The override flag confuses cURL's body-handling logic.-s to silence progress and --fail if you only want successful responses.-D - to dump headers separately if scripting.