HEAD Request — Metadata Without the Body
Understand how HEAD requests work to retrieve only response headers without the body, useful for cache validation and resource checking.
Detailed Explanation
What HEAD Does
The HEAD method is identical to GET except that the server must not return a response body. The response headers are exactly the same as those returned by an equivalent GET request. This makes HEAD perfect for checking resource metadata without downloading the entire content.
Request Example
HEAD /downloads/report.pdf HTTP/1.1
Host: files.example.com
Response Example
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 2456789
Last-Modified: Mon, 15 Jan 2026 10:30:00 GMT
ETag: "pdf-v3"
Notice the response includes Content-Length (2.4 MB) but no body is transferred, saving bandwidth entirely.
Properties
| Property | Value |
|---|---|
| Safe | Yes |
| Idempotent | Yes |
| Cacheable | Yes |
| Request Body | Not expected |
Practical Uses
- Check if a resource exists — A
200means it exists,404means it does not - Validate cache — Compare
ETagorLast-Modifiedheaders against cached versions - Check file size — Read
Content-Lengthbefore deciding to download - Monitor uptime — HEAD requests are lighter than GET for health checks
HEAD in curl
curl -I https://files.example.com/downloads/report.pdf
The -I flag tells curl to send a HEAD request.
Use Case
A download manager checks file size with HEAD before downloading to show a progress bar. A monitoring service sends HEAD requests every 30 seconds to check if a website is online without wasting bandwidth on the full response body.