4xx Client errors
Last updated Jun 09, 2026

What is HTTP Status Code 412? - Precondition Failed

Benjamin Bouchet
Benjamin Bouchet
Get your free
Abstract
 API key now
stars rating
4.8 from 1,863 votes
See why the best developers build on Abstract
START FOR FREE
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required

The HTTP Status Code 412 means that the server does not meet one of the preconditions that the client put in its request header fields.

Frequently Asked Questions

What does the HTTP 412 status code mean?

HTTP 412 Precondition Failed is a client error response that means the server does not meet one or more preconditions the client specified in its request headers. It belongs to the 4xx class, so the problem originates on the client side rather than the server. The server is rejecting the request because a condition the client set was not satisfied.

When does a server return a 412 response?

A server returns 412 when a request includes conditional headers such as If-Match, If-None-Match, If-Unmodified-Since, or If-Modified-Since, and the condition those headers express is not met. This typically happens on state-changing methods like PUT or DELETE — not on GET or HEAD requests. For example, if a client sends an If-Match header with a stored ETag and the resource has since been updated, the ETag no longer matches and the server responds with 412.

How do I fix an HTTP 412 error?

First, re-fetch the resource to get its current state and the latest ETag or modification timestamp from the response headers. Then reapply your changes and include the updated ETag in the If-Match header before retrying the request. If you are seeing 412 unexpectedly, check whether your client is sending conditional headers it does not need and remove them.

What is the difference between HTTP 412 and HTTP 428?

HTTP 412 means the client did send a precondition header but the condition was not satisfied. HTTP 428 Precondition Required means the server requires a precondition header and the client did not include one at all. In short, 412 is about a failed condition and 428 is about a missing condition.

What is the difference between HTTP 412 and HTTP 304?

HTTP 304 Not Modified is returned on conditional GET or HEAD requests when the resource has not changed, telling the client it can use its cached copy. HTTP 412 is returned on modification requests (PUT, DELETE) when a condition such as If-Match or If-Unmodified-Since fails, preventing the update from proceeding. They both involve conditional headers but serve opposite purposes in different contexts.

What is a common real-world use case for HTTP 412?

The most common use case is preventing concurrent edit conflicts, sometimes called a mid-air collision. A server includes an ETag in its response when delivering a resource. When a client later tries to update that resource, it sends the stored ETag in an If-Match header. If another client has already modified the resource in the meantime, the ETag no longer matches and the server returns 412, protecting data integrity by refusing the stale update.

Get your free
API
key now
stars rating
4.8 from 1,863 votes
See why the best developers build on Abstract
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required