Error Codes Wiki

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

  1. 1Add the required conditional headers (If-Match, If-Unmodified-Since) to your request.
  2. 2First GET the resource to obtain its current ETag.
  3. 3Include the ETag in an If-Match header with your PUT or PATCH request.
  4. 4Review the API documentation for required conditional headers.

Tags

httpclient-errorpreconditionconditionaletag

Related Items

More in 4xx Client Error

Frequently Asked Questions

It means the server requires your request to include conditional headers like If-Match. This prevents accidentally overwriting changes made by others.