HTTP

HTTP 423 Locked vs 428 Precondition Required

Both HTTP 423 (Locked) and 428 (Precondition Required) belong to the 4xx Client Error category. 423 indicates that the resource is locked and cannot be modified (WebDAV). Meanwhile, 428 means that the server requires the request to be conditional (e.g., include If-Match header) to prevent lost updates.

Description

The resource is locked and cannot be modified (WebDAV).

When You See It

When trying to edit a file that another user has locked in WebDAV.

How to Fix

Wait for the lock to be released, or request the lock owner to unlock it.

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 423: The resource is locked and cannot be modified (WebDAV).

2.

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

3.

You encounter 423 when when trying to edit a file that another user has locked in WebDAV.

4.

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

When to Use Which

For 423 (Locked): Wait for the lock to be released, or request the lock owner to unlock it. For 428 (Precondition Required): Fetch the resource first to get its ETag, then include If-Match in your update request.

Learn More