@http · HTTP status codes, explained HTTP/1.1 412 Precondition Failed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4xx · Client error An If-* header condition didn't hold. WHAT IT MEANS ──────────────────────────────────────────────────────────── A condition in the request headers, such as If-Match or If-Unmodified-Since, didn't hold, so the server didn't apply the change. This is how HTTP prevents lost updates: the edit only applies if nobody changed the resource since you read it. WHY YOU'RE SEEING IT ───────────────────────────────────────────────────── → Someone else updated the resource after you fetched it, so its ETag changed. → Sending a stale ETag from an old cache. HOW TO FIX IT ──────────────────────────────────────────────────────────── → Fetch the current version, merge your changes and retry with the new ETag. EXAMPLE RESPONSE ───────────────────────────────────────────────────────── HTTP/1.1 412 Precondition Failed ETag: "v8" Content-Type: application/json  {"error": "resource changed; reload and retry"} related 428 Precondition Required   409 Conflict   304 Not Modified spec RFC 9110 §15.5.13 https://www.rfc-editor.org/rfc/rfc9110#section-15.5.13 web https://athttp.com/412 ← curl athttp.com/411 curl athttp.com/413 →