HTTP

HTTP 428 Precondition Required vs 508 Loop Detected

HTTP 428 (Precondition Required) is a 4xx Client Error response, while 508 (Loop Detected) is a 5xx Server Error response. 428 indicates that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates. In contrast, 508 means that the server detected an infinite loop while processing the request (WebDAV).

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.

Description

The server detected an infinite loop while processing the request (WebDAV).

When You See It

When WebDAV encounters circular references in bindings.

How to Fix

Fix the circular reference in the WebDAV configuration.

Key Differences

1.

428 is a 4xx Client Error response, while 508 is a 5xx Server Error response.

2.

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

3.

HTTP 508: The server detected an infinite loop while processing the request (WebDAV).

4.

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

5.

You encounter 508 when when WebDAV encounters circular references in bindings.

When to Use Which

For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request. For 508 (Loop Detected): Fix the circular reference in the WebDAV configuration.

Learn More