HTTP status code 428 Precondition Required indicates that the server requires the request to be conditional. This status is used to prevent lost updates by ensuring the client includes specific preconditions before modifying a resource.
If-MatchA server responds with 428 when a client attempts to update a resource without providing required preconditions. Most commonly, servers expect an If-Match header containing an ETag.
// Example HTTP request missing required precondition PUT /api/users/42 HTTP/1.1 Host: example.com Content-Type: application/json {"name":"New Name"}The server rejects the request and responds with status code 428 Precondition Required, indicating that a conditional header is mandatory.
Toggle the header below to see how the server handles the request.
PUT /api/resource HTTP/1.1 Host: example.com Content-Type: application/json {"status": "update"}// Correct request including If-Match header PUT /api/users/42 HTTP/1.1 Host: example.com If-Match: "e0023aa4" Content-Type: application/json {"name":"New Name"}If-Match for safe updatesIf-Match