HTTP 300 Multiple Choices vs 428 Precondition Required
HTTP 300 (Multiple Choices) is a 3xx Redirection response, while 428 (Precondition Required) 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, 428 means that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
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
The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
When You See It
When an API requires optimistic concurrency control via ETags.
How to Fix
Fetch the resource first to get its ETag, then include If-Match in your update request.
Key Differences
300 is a 3xx Redirection response, while 428 is a 4xx Client Error response.
HTTP 300: The request has more than one possible response. The client should choose one of them.
HTTP 428: The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
You encounter 300 when when a resource is available in multiple formats (e.g., different languages or media types).
You encounter 428 when when an API requires optimistic concurrency control via ETags.
When to Use Which
For 300 (Multiple Choices): Select the appropriate resource variant. Send an Accept header with your preferred content type. For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.