4xx Client Errors

HTTP 428 Precondition Required

The origin server requires the request to be conditional (RFC 6585).

When is 428 used?

  • Preventing lost updates with If-Match

How to handle a 428 response

Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 428 from your server

Node.js (Express)

res.status(428).json({ message: 'Precondition Required' });

Python (Flask)

return {"message": "Precondition Required"}, 428

Go (net/http)

w.WriteHeader(428)

Frequently Asked Questions

What does HTTP 428 mean?

428 Precondition Required: The origin server requires the request to be conditional (RFC 6585).

Is 428 an error?

Yes. 428 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.