HEAD method
HEAD asks for the response metadata of GET without transferring response content.
- methods
- retrieval
- metadata
Defined meaning
HEAD is identical to GET except that the server must not send response
content. It is safe, idempotent, and cacheable. Servers should send the same fields
as GET, but may omit fields whose values are determined only while generating
content.
HEAD /manual HTTP/1.1
Host: example.invalid
Expected result: a successful response can describe the selected
representation with fields such as Content-Type and validators, but no response
content follows.
Use
HEAD can inspect metadata or validate links without transferring a representation. It is not guaranteed to be cheaper for the origin: an implementation might still generate the representation to calculate its fields.
Common mistake
An empty HEAD response is correct behavior, not evidence that the corresponding GET representation is empty. Compare status and fields with GET when diagnosing a server that implements HEAD inconsistently.
