If-Match

The request header that makes a write conditional: the server applies it only if the resource still has the ETag the client sends.

In more detail

If someone else changed the resource since you read it, the tags differ and the server answers 412 Precondition Failed without changing anything. It is the HTTP form of optimistic concurrency control, preventing lost updates.

Example

In the APIs course: The course service requires If-Match on PATCH.

Related terms

Taught in

References