HTTP 413 Content Too Large vs 428 Precondition Required
Both HTTP 413 (Content Too Large) and 428 (Precondition Required) belong to the 4xx Client Error category. 413 indicates that the request payload exceeds the server's size limit. Meanwhile, 428 means that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
Description
The request payload exceeds the server's size limit.
When You See It
When uploading files that exceed the server's maximum upload size.
How to Fix
Reduce the payload size. Check server limits (Nginx: client_max_body_size, Apache: LimitRequestBody).
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
HTTP 413: The request payload exceeds the server's size limit.
HTTP 428: The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.
You encounter 413 when when uploading files that exceed the server's maximum upload size.
You encounter 428 when when an API requires optimistic concurrency control via ETags.
When to Use Which
For 413 (Content Too Large): Reduce the payload size. Check server limits (Nginx: client_max_body_size, Apache: LimitRequestBody). For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.