Skip to content

412 Precondition Failed (HTTP Status Code 412)

Updated: at 09:12 AM

HTTP status code 412 “Precondition Failed” indicates that the server has refused to perform the request because one or more access conditions specified in the request’s headers evaluated to false. This status code is often used in conditional requests, where the client includes one or more header fields to specify conditions under which the request should be processed.

Common Scenarios for 412 Status Code

Characteristics of 412 Precondition Failed

Example Response

HTTP/1.1 412 Precondition Failed
Content-Type: text/html
Content-Length: 178

<html>
<head><title>412 Precondition Failed</title></head>
<body>
<h1>412 Precondition Failed</h1>
<p>The precondition on the request for the URL evaluated to false. It is either not set or not set to the correct value.</p>
</body>
</html>

In this example, the server indicates that the request cannot be processed because the precondition specified by the client is not met. The client should review the conditions it has specified and resend the request with the correct headers if necessary.

Note: Clients receiving a 412 Precondition Failed status should check their request headers for any conditional requests that may be specified incorrectly. If the client intended to perform the request without conditions, it should remove any precondition headers and resend the request. Additionally, clients should be aware that some servers may not support all conditional request headers, which could also lead to a 412 error.