Inspect response headers without downloading the body.
curl -I https://example.comTransfer data to or from a URL; -I requests response headers only.
curl [OPTION]... URL...Inspect response headers without downloading the body.
curl -I https://example.comSave a successful response to a file and report errors.
curl -fsS https://example.com/data.json -o data.json| Option / clause | Description |
|---|---|
-I, --head | Fetch response headers only. |
-L, --location | Follow HTTP redirects. |
-o FILE, --output FILE | Write response data to FILE. |
-O, --remote-name | Save using the remote filename. |
-H, --header HEADER | Add a request header. |
-d, --data DATA | Send request data (often used for POST). |
-f, --fail | Return an error for HTTP error responses without outputting the error page. |
-sS, --silent --show-error | Hide progress while still showing errors. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.