HTTP

HTTP 308 Permanent Redirect vs 428 Precondition Required

HTTP 308 (Permanent Redirect) is a 3xx Redirection response, while 428 (Precondition Required) is a 4xx Client Error response. 308 indicates that the resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed. 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 resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.

When You See It

For permanent URL changes where POST requests must remain POST.

How to Fix

Update all references to the new URL. The HTTP method is preserved.

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.

308 is a 3xx Redirection response, while 428 is a 4xx Client Error response.

2.

HTTP 308: The resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.

3.

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

4.

You encounter 308 when for permanent URL changes where POST requests must remain POST.

5.

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

When to Use Which

For 308 (Permanent Redirect): Update all references to the new URL. The HTTP method is preserved. For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.

Learn More