HTTP 428 Precondition Required — What It Means & How to Fix It
Error4xx client error
Overview
The HTTP 428 Precondition Required status code indicates the server requires the request to be conditional, meaning it must include headers like If-Match or If-Unmodified-Since.
Key Details
- This status code is defined in RFC 6585.
- The server requires conditional headers to prevent lost update problems.
- It is different from 412 Precondition Failed, which means the condition was present but evaluated to false.
- Used to enforce optimistic concurrency control.
Common Causes
- The request is missing required conditional headers like If-Match.
- The server enforces optimistic locking and requires an ETag for updates.
- API design requires conditional requests to prevent data races.
Steps
- 1Add the required conditional headers (If-Match, If-Unmodified-Since) to your request.
- 2First GET the resource to obtain its current ETag.
- 3Include the ETag in an If-Match header with your PUT or PATCH request.
- 4Review the API documentation for required conditional headers.
Tags
httpclient-errorpreconditionconditionaletag
Related Items
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
It means the server requires your request to include conditional headers like If-Match. This prevents accidentally overwriting changes made by others.