HTTP: The Definitive Guide
by David Gourley, Brian Totty, Marjorie Sayer, Anshu Aggarwal, Sailu Reddy
Name
If-Match
Synopsis
Like the If-Modified-Since header, the If-Match header can be used to make a request conditional. Instead of a date, the If-Match request uses an entity tag. The server compares the entity tag in the If-Match header with the current entity tag of the resource and returns the object if the tags match.
The server should use the If-Match value of “*” to match any entity tag it has for a resource; “*” will always match, unless the server no longer has the resource.
This header is useful for updating resources that a client or cache already has. The resource is returned only if it has changed—that is, if the previously requested object’s entity tag does not match the entity tag of the current version on the server. Chapter 7 discusses conditional requests in detail.
Type
Request header
Basic Syntax
If-Match: (“*” | 1# entity-tag)
Example
If-Match: “11e92a-457b-31345aa”
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access