HTTP

HTTP 226 IM Used vs 412 Precondition Failed

HTTP 226 (IM Used) is a 2xx Success response, while 412 (Precondition Failed) is a 4xx Client Error response. 226 indicates that the server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations. In contrast, 412 means that one or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

Description

The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.

When You See It

When using delta encoding to reduce bandwidth.

How to Fix

Rarely encountered. The response uses Instance Manipulations (IM) as specified.

Description

One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

When You See It

When using conditional requests with ETags and the resource has changed.

How to Fix

Refresh the ETag/Last-Modified value and retry with updated preconditions.

Key Differences

1.

226 is a 2xx Success response, while 412 is a 4xx Client Error response.

2.

HTTP 226: The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.

3.

HTTP 412: One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

4.

You encounter 226 when when using delta encoding to reduce bandwidth.

5.

You encounter 412 when when using conditional requests with ETags and the resource has changed.

When to Use Which

For 226 (IM Used): Rarely encountered. The response uses Instance Manipulations (IM) as specified. For 412 (Precondition Failed): Refresh the ETag/Last-Modified value and retry with updated preconditions.

Learn More