DELAPARRA
Index
Color
NL
Category: HTTP headers

If-Match

Explained by Updated

What is If-Match?

If-Match: Send the request only if the current ETag MATCHES. Used for optimistic concurrency in PUT/PATCH. If-Match makes a request conditional. The client sends the ETag of the version it last saw, and the server only applies the change if the resource still has that ETag. This prevents lost updates. Two people open the same record, both edit it, and both save. Without a check, the second save silently overwrites the first. With If-Match, the second save fails with 412 Precondition Failed, and the client can show the latest version and let the user decide.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about If-Match

What should you keep in mind with If-Match?

It is called optimistic concurrency, because you do not lock the record while someone edits; you only check for conflicts when saving. APIs that manage shared data, such as documents, settings or inventory, benefit from it. Without ETags, a version number or updated_at timestamp sent with the update achieves the same.

What does an example of If-Match look like?

If-Match: "abc123"

At a glance

CategoryHTTP headers
Explained by
Updated

More HTTP headers terms

All terms starting with I

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.