412

HTTP 412 Precondition Failed

4xx Client Error

  1. Home
  2. > HTTP Status Codes >
  3. > 4xx >
  4. 412
4xx Client Error RFC 7232, Section 4.2

What is HTTP 412 Precondition Failed?

The 412 (Precondition Failed) status code indicates that one or more conditions given in the request header fields evaluated to false when tested on the server. This is used with conditional requests using headers like If-Match, If-None-Match, If-Modified-Since, or If-Unmodified-Since.

Common Use Cases

  • Optimistic concurrency control with If-Match
  • Conditional updates to prevent overwriting changes
  • Cache validation with ETag conditions
Help2Code Logo
Menu