HTTP 300 Multiple Choices vs 412 Precondition Failed
HTTP 300 (Multiple Choices) is a 3xx Redirection response, while 412 (Precondition Failed) is a 4xx Client Error response. 300 indicates that the request has more than one possible response. The client should choose one of them. In contrast, 412 means that one or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.
Description
The request has more than one possible response. The client should choose one of them.
When You See It
When a resource is available in multiple formats (e.g., different languages or media types).
How to Fix
Select the appropriate resource variant. Send an Accept header with your preferred content type.
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
300 is a 3xx Redirection response, while 412 is a 4xx Client Error response.
HTTP 300: The request has more than one possible response. The client should choose one of them.
HTTP 412: One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.
You encounter 300 when when a resource is available in multiple formats (e.g., different languages or media types).
You encounter 412 when when using conditional requests with ETags and the resource has changed.
When to Use Which
For 300 (Multiple Choices): Select the appropriate resource variant. Send an Accept header with your preferred content type. For 412 (Precondition Failed): Refresh the ETag/Last-Modified value and retry with updated preconditions.