Skip to content

412 Precondition Failed ​

Meaning ​

One or more conditions given in the request header fields evaluated to false. The server does not meet a precondition specified by the client.

When to Use ​

When the request includes conditional headers (like If-Match, If-Unmodified-Since, etc.) and the server determines that one of those conditions is not met for the target resource.

Example ​

A GET request with If-Unmodified-Since on a resource that has been modified since that date returns 412 Precondition Failed, because the precondition was not satisfied.

When Not to Use ​

Do not use if there were no precondition headers in the request. If the request fails for other reasons unrelated to conditions (e.g., validation), use a different status code.

Source ​

RFC 9110


Released under the MIT License.