If-MatchIf-Match is a conditional request header that lets the request proceed only if the client's ETag matches the server's current ETag. It is mainly used on writes (PUT, DELETE) as optimistic locking to prevent concurrent-edit conflicts.
Its behavior is the opposite of If-None-Match. The client stores the ETag it received when reading the resource and sends it via If-Match on the modifying request. The server checks whether it equals the current ETag: if so (nobody changed it meanwhile) it applies the change; if not, someone edited first, so it rejects with 412 Precondition Failed. This prevents the lost-update problem where you overwrite a change made after you read.
`If-Match: *` means 'as long as the resource exists' and fails if it doesn't (update-if-exists), mirroring the create-if-absent `If-None-Match: *`.
A server can require If-Match to prevent unsafe unconditional updates by responding 428 Precondition Required. If-Match uses strong ETag comparison for exact matching.
If-Match: <etag>[, <etag>]* | *e.g. If-Match: "686897696a7c876b7e"