HTTP 412 Precondition Failed means one or more conditions specified in the request headers (If-Match, If-Unmodified-Since, If-None-Match) evaluated to false. The server will not perform the requested operation because the preconditions are not met.
412 Precondition FailedGET /file/document.pdf HTTP/1.1
Host: www.example.com
User-Agent: curl/8.6.0
If-Match: "abc123"
Accept: */*HTTP/1.1 412 Precondition Failed
Content-Type: text/html; charset=utf-8
ETag: "xyz789"
Content-Length: 205
<!doctype html>
<html lang="en">
<head>
<title>412 Precondition Failed</title>
</head>
<body>
<h1>Precondition Failed</h1>
<p>The file has changed since you last retrieved it. Refresh and try again.</p>
</body>
</html>GET the resource to obtain the latest ETag or Last-Modified date, then retry with updated precondition headers.
Compare the current resource state with your intended changes and merge if necessary.
If you do not need optimistic concurrency control, remove the conditional headers.
The If-Match header contained an ETag that does not match the current version of the resource — someone else modified it.
The If-Unmodified-Since condition failed because the resource was modified after the specified date.
| Specification | Section |
|---|---|
| HTTP Semantics | RFC 9110 §15.5.13 |
This reference was compiled from official RFCs, protocol specifications, and hands-on troubleshooting experience. AI tools were used primarily for formatting and organizing the content on the page.