Error Codes Wiki

HTTP 428 Precondition Required — What It Means & How to Fix It

Error4xx client error

About HTTP 428 Precondition Required

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. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: 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.. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: 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.. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Add the required conditional headers (If-Match, If-Unmodified-Since) to your request.. First GET the resource to obtain its current ETag.. Include the ETag in an If-Match header with your PUT or PATCH request.. Review the API documentation for required conditional headers.. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our HTTP Status Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

What does HTTP 428 mean?

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

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.