Did you know?
curl -I fetches only the response headers of a URL.
Great for checking redirects, caching and status codes without downloading the page.
- Networking
- Last checked
Explained
To check what a web server sends back, you rarely need the whole page. curl -I sends a HEAD request and prints the status line and headers:
curl -I https://example.com
HTTP/2 200
content-type: text/html; charset=UTF-8
cache-control: max-age=3600
server: nginx
Useful combinations:
curl -IL http://example.comfollows redirects and shows the headers of every hop, which makes redirect chains and HTTP-to-HTTPS rules easy to debug.curl -I -H "Accept-Encoding: gzip" URLchecks whether compression is enabled.curl -I --resolve example.com:443:203.0.113.10 https://example.comtests a new server before you change DNS.
Some applications answer HEAD requests differently from GET, or not at all. In that case, make a normal request but print only the headers:
curl -s -D - -o /dev/null https://example.com
Learn more
- How to Show Curl Headers in Responses & Requests Full guide · Updated Apr 2025
-
curlcommand cheat sheet Options and copy-ready examples
