HTTP

HTTP 408 Request Timeout vs 428 Precondition Required

Both HTTP 408 (Request Timeout) and 428 (Precondition Required) belong to the 4xx Client Error category. 408 indicates that the server timed out waiting for the request. The client did not produce a request within the time the server was prepared to wait. Meanwhile, 428 means that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.

Description

The server timed out waiting for the request. The client did not produce a request within the time the server was prepared to wait.

When You See It

When a client takes too long to send the complete request (slow upload, network issues).

How to Fix

Retry the request. Check your network connection. Reduce request payload size.

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

1.

HTTP 408: The server timed out waiting for the request. The client did not produce a request within the time the server was prepared to wait.

2.

HTTP 428: The server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.

3.

You encounter 408 when when a client takes too long to send the complete request (slow upload, network issues).

4.

You encounter 428 when when an API requires optimistic concurrency control via ETags.

When to Use Which

For 408 (Request Timeout): Retry the request. Check your network connection. Reduce request payload size. For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.

Learn More