HTTP 428 Precondition Required
Updated Free mock REST & WebSocket APIs
HTTP 428 Precondition Required — The server requires the request to be conditional (If-Match etc.) to prevent lost updates.
- Class
- 4xx Client Error
- Defined in
- RFC 6585
- Official
- Yes (IANA registry)
- Cacheable by default
- No (unless Cache-Control/Expires say so)
- Safe to retry
- Not without changing the request
Try it: get a real 428 response
Our test endpoint answers every request with 428 Precondition Required.
curl -i https://mockfox.dev/api/status/428Use it in tests, health-check monitors or to see how your client handles a 428. Add ?delay=2000 to slow it down.
What does HTTP 428 mean?
An API answers 428 when a client tries to PUT or DELETE without an If-Match header, forcing clients to prove they've seen the latest version. The client should GET the resource, read its ETag, and retry with If-Match. Used by some REST APIs to enforce optimistic concurrency.
How to fix 428
- Visitors: Reload the page, check the address for typos, and clear the site's cookies. If it persists, the site owner needs to fix it.
- Developers: Read the response body and server logs for details, fix the request (method, headers, body, credentials) and return a clear error message to clients.
Example 428 response
HTTP/1.1 428 Precondition Required
Content-Type: application/json
{"status":428,"error":"Precondition Required"}4xx Client Error: The request contains an error or can't be fulfilled — fix the request before retrying. See the full list of HTTP status codes.
Related status codes
- 412 Precondition FailedA condition in the request headers (If-Match, If-Unmodified-Since…) evaluated to false.
- 409 ConflictThe request conflicts with the current state of the resource.
Related tools
Frequently asked questions
What does HTTP 428 Precondition Required mean?
The server requires the request to be conditional (If-Match etc.) to prevent lost updates.
Is 428 a client or a server error?
428 is a 4xx code, so it signals a problem with the request (as seen by the server). Retrying the identical request usually gives the same result.
Where is 428 defined?
In RFC 6585. It's listed in the IANA HTTP Status Code Registry.
How can I test how my app handles a 428?
Call https://mockfox.dev/api/status/428 — it responds with 428 to any method, with CORS enabled. Add ?delay=2000 to simulate a slow response.