HEAD
Same as GET but returns only headers, no body. Useful for checking existence, metadata, or cache validity without transferring the full resource.
Properties
- Safe
- Yes
- Idempotent
- Yes
- Has body
- No
Typical use cases
Check if resource exists, get Content-Length, validate cache (ETag/Last-Modified)
cURL example
curl -I https://api.example.com/users/1
Typical response
Headers only (Content-Type, Content-Length, ETag, etc.)
Common status codes
200 OK404 Not Found304 Not Modified500 Server Error
Comparison with similar methods
HEAD is GET without body. Use when you only need metadata.