← All status codes4xx – Client Error

HTTP 412 – Precondition Failed

One of the conditions in the request headers is not met by the server.

Common use case

Used with conditional requests like If-Match, to prevent a client from updating a resource that has changed since it last fetched it.

Example

HTTP/1.1 412 Precondition Failed

History

Part of HTTP/1.1 (RFC 2068, 1997).

Did you know?

It is the read-before-write safety net behind ETag-based optimistic concurrency control.