HEAD and OPTIONS: Metadata Operations
What you'll learn: How to use HTTP HEAD to check resource metadata without downloading content, and OPTIONS to discover what operations a resource supports.
The Core Idea
While GET, POST, PUT, and DELETE manipulate resource data, HEAD and OPTIONS are special HTTP verbs designed purely for gathering information about resources—without modifying them or even retrieving their full content.
HEAD works exactly like GET, but the server returns only the headers—no response body. Think of it like asking "What can you tell me about this package?" without actually opening it. You get metadata like size, last-modified date, content type, and cache headers, which helps you decide whether to fetch the full resource.
Common HEAD use cases:
- Checking if a resource exists (status code 200 vs 404)
- Verifying a file's size before downloading
- Checking cache freshness (ETags, Last-Modified headers)
- Testing links without bandwidth overhead
OPTIONS answers the question: "What am I allowed to do with this resource?" The server responds with an Allow header listing supported HTTP methods (e.g., Allow: GET, POST, DELETE, HEAD, OPTIONS). It's like reading the instruction manual before attempting an operation.
Common OPTIONS use cases:
- CORS preflight requests (browsers use this automatically)
- API discovery—learning what operations are available
- Checking authentication requirements before attempting actions
Analogy
HEAD is like weighing a sealed box and reading its shipping label—you learn about the contents without opening it. OPTIONS is like asking a building's receptionist "What services are available here?" before entering.
Key Takeaway: HEAD retrieves metadata without body content for efficiency, while OPTIONS discovers allowed operations on a resource—both are safe, idempotent metadata operations essential for smart API clients.