You are viewing documentation for an outdated version. It is no longer supported!
If-Match
Class: \Aedart\ETags\Preconditions\Rfc9110\IfMatch
Applicable
When If-Match
header is requested.
Condition
- If
If-Match
header is "*", the condition is true if a current representation (Etag) exists for the target resource. - If
If-Match
header is a list of Etags, the condition is true if any of the listed tags match the Etag of the selected representation (the resource). - Otherwise, the condition is false.
When it passes
When condition passes, evaluation continues to If-None-Match precondition.
When it fails
If the request is state-changing, e.g. POST
, PUT
, PATCH
... etc, the precondition will attempt to detect whether the requested state-change has already succeeded or not. This is done via the hasStateChangeAlreadySucceeded()
, in the given resource. Should a state-change already have succeeded, then the abortStateChangeAlreadySucceeded()
action method is invoked.
When the request is not state-changing, e.g. for GET
, HEAD
requests, or when a state-change could not be determined, the abortPreconditionFailed()
action method is invoked.