412 vs 428
Precondition Failed vs Precondition Required
412Precondition Failed
Your conditions weren't met! You said 'only if...' and the server said 'nope, that's not the case.'
HTTP/1.1 412 Precondition Failed
ETag: "new-etag-value"428Precondition Required
Say the magic words! The server needs conditional headers like If-Match to prevent you from overwriting someone else's changes.
HTTP/1.1 428 Precondition Requiredβ412Precondition Failed
π428Precondition Required
Description
The client has indicated preconditions in its headers which the server does not meet.
Common Causes
- If-Match header doesn't match ETag
- If-Unmodified-Since condition failed
- Conditional request preconditions not satisfied
Description
The origin server requires the request to be conditional to prevent lost updates.
Common Causes
- Missing If-Match or If-Unmodified-Since header
- Optimistic locking required
- Concurrent modification protection