Skip to main content

HTTP Conditional Request Evaluator API

REAL DATA

Evaluate RFC 9110 conditional requests in the required precedence order, including strong/weak ETags, wildcard resources, 304 and 412 decisions.

Authoritative reference data or standards computation

Base URL
/api/http-preconditions
Capabilities
1 route
Last updated
July 29, 2026
Data source

GET /api/http-preconditions/evaluate

Live requestRuns against the public API
No key required
GET/api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22

Request parameters

Registered method token. GET/HEAD use 304 for not-modified, representation-changing methods use 412, and CONNECT/OPTIONS/TRACE/PRI ignore every precondition.

Whether a current selected representation exists; controls wildcard entity-tag conditions.

Current representation ETag, including quotes and optional W/ prefix.

Current Last-Modified value in canonical IMF-fixdate form.

If-Match field value: * or a bounded comma-separated entity-tag list.

If-None-Match field value: * or a bounded comma-separated entity-tag list.

If-Modified-Since in any RFC 9110 HTTP-date form. Invalid values are ignored, matching HTTP behavior.

If-Unmodified-Since in any RFC 9110 HTTP-date form. Ignored when If-Match is present.

Advanced response options4 options

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22"
const res = await fetch("https://randomapi.dev/api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 8
method enum

Registered method token. GET/HEAD use 304 for not-modified, representation-changing methods use 412, and CONNECT/OPTIONS/TRACE/PRI ignore every precondition.

default: GET
allowed: ACL | BASELINE-CONTROL | BIND | CHECKIN | CHECKOUT | CONNECT | COPY | DELETE | GET | HEAD | LABEL | LINK | LOCK | MERGE | MKACTIVITY | MKCALENDAR | MKCOL | MKREDIRECTREF | MKWORKSPACE | MOVE | OPTIONS | ORDERPATCH | PATCH | POST | PRI | PROPFIND | PROPPATCH | PUT | QUERY | REBIND | REPORT | SEARCH | TRACE | UNBIND | UNCHECKOUT | UNLINK | UNLOCK | UPDATE | UPDATEREDIRECTREF | VERSION-CONTROL
example: method=PUT
exists boolean

Whether a current selected representation exists; controls wildcard entity-tag conditions.

default: true
example: exists=true
etag string

Current representation ETag, including quotes and optional W/ prefix.

allowed: ≤ 512
example: etag="revision-7"
lastModified string

Current Last-Modified value in canonical IMF-fixdate form.

allowed: ≤ 64
example: lastModified=Sun, 06 Nov 1994 08:49:37 GMT
ifMatch string

If-Match field value: * or a bounded comma-separated entity-tag list.

allowed: ≤ 2048
example: ifMatch="revision-7"
ifNoneMatch string

If-None-Match field value: * or a bounded comma-separated entity-tag list.

allowed: ≤ 2048
example: ifNoneMatch=W/"preview", "revision-7"
ifModifiedSince string

If-Modified-Since in any RFC 9110 HTTP-date form. Invalid values are ignored, matching HTTP behavior.

allowed: ≤ 64
example: ifModifiedSince=Sun, 06 Nov 1994 08:49:37 GMT
ifUnmodifiedSince string

If-Unmodified-Since in any RFC 9110 HTTP-date form. Ignored when If-Match is present.

allowed: ≤ 64
example: ifUnmodifiedSince=Sun, 06 Nov 1994 08:49:37 GMT
Universal parameters Shared response and formatting options 4
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=method,exists
exclude list

Return all fields except these (comma-separated).

example: exclude=evaluations
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 8
method string

Canonical request method used for status selection.

example: PUT

exists boolean

Whether the modeled selected representation exists.

example: true

currentEtag string nullable

Current entity-tag or null when unavailable.

example: "revision-7"

lastModified string (HTTP-date) nullable

Canonical Last-Modified value or null.

example: Sun, 06 Nov 1994 08:49:37 GMT

decision string

proceed, notModified or preconditionFailed.

example: proceed

status integer nullable

304/412 when a precondition determines a response; otherwise null.

example: null

controllingCondition string nullable

Condition that determined 304/412, or null when processing proceeds.

example: null

evaluations object[]

Ordered condition results with true, false, ignored or skipped explanations.

example: [{"condition":"If-Match","result":"true","detail":"The current representation strongly matches the condition."}]

Documented examples

Build-generated requests and complete responses
3
Allow an update with a matching strong ETag
GET /api/http-preconditions/evaluate?method=PUT&etag=%22revision-7%22&ifMatch=%22revision-7%22
{
  "data": {
    "method": "PUT",
    "exists": true,
    "currentEtag": "\"revision-7\"",
    "lastModified": null,
    "decision": "proceed",
    "status": null,
    "controllingCondition": null,
    "evaluations": [
      {
        "condition": "If-Match",
        "result": "true",
        "detail": "The current representation strongly matches the condition."
      }
    ]
  },
  "meta": {
    "endpoint": "http-preconditions",
    "route": "/evaluate",
    "params": {
      "method": "PUT",
      "exists": true,
      "etag": "\"revision-7\"",
      "ifMatch": "\"revision-7\""
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Return 304 for a weak cache validator match
GET /api/http-preconditions/evaluate?method=GET&etag=%22revision-7%22&ifNoneMatch=W%2F%22revision-7%22
{
  "data": {
    "method": "GET",
    "exists": true,
    "currentEtag": "\"revision-7\"",
    "lastModified": null,
    "decision": "notModified",
    "status": 304,
    "controllingCondition": "If-None-Match",
    "evaluations": [
      {
        "condition": "If-None-Match",
        "result": "false",
        "detail": "A current representation weakly matches the condition."
      }
    ]
  },
  "meta": {
    "endpoint": "http-preconditions",
    "route": "/evaluate",
    "params": {
      "method": "GET",
      "exists": true,
      "etag": "\"revision-7\"",
      "ifNoneMatch": "W/\"revision-7\""
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Create only when no representation exists
GET /api/http-preconditions/evaluate?method=PUT&exists=false&ifNoneMatch=*
{
  "data": {
    "method": "PUT",
    "exists": false,
    "currentEtag": null,
    "lastModified": null,
    "decision": "proceed",
    "status": null,
    "controllingCondition": null,
    "evaluations": [
      {
        "condition": "If-None-Match",
        "result": "true",
        "detail": "No current representation weakly matches the condition."
      }
    ]
  },
  "meta": {
    "endpoint": "http-preconditions",
    "route": "/evaluate",
    "params": {
      "method": "PUT",
      "exists": false,
      "ifNoneMatch": "*"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Evaluates the four HTTP request preconditions used for cache validation and optimistic concurrency: If-Match, If-Unmodified-Since, If-None-Match and If-Modified-Since.

The route follows RFC 9110 section 13.2.2 precedence. If-Match uses strong entity-tag comparison and suppresses If-Unmodified-Since; If-None-Match uses weak comparison and suppresses If-Modified-Since. A matching If-None-Match produces 304 for GET/HEAD but 412 for methods that select or modify a representation. RFC 9110 requires methods such as CONNECT, OPTIONS and TRACE to ignore all preconditions; the HTTP/2 connection-preface sentinel PRI is ignored too. The * form tests whether a selected representation exists, so If-None-Match: * is useful for create-only writes.

The output is an explanation, not an HTTP response: decision, status, controllingCondition and an ordered evaluation trace show exactly why the result was reached. Conditional dates accept all three RFC 9110 HTTP-date forms (IMF-fixdate, obsolete RFC 850 and asctime), while invalid values are ignored as HTTP requires. The modeled current Last-Modified value remains canonical IMF-fixdate. Malformed entity-tag syntax is a 400.

This calculator deliberately does not model the optional “change already succeeded” exception, authorization, method semantics or representation selection. It assumes normal request checks have already completed and evaluates only the supplied current representation state and precondition fields.

Use it for

  • Implement If-Match optimistic concurrency without getting weak-tag comparison wrong
  • Test whether a conditional GET should return 304 or continue with a representation
  • Explain wildcard create/update guards against present and absent resources
  • Debug precedence when clients send both entity-tag and date validators

Frequently asked questions

Does If-Match use weak or strong ETag comparison?

Strong comparison. A weak tag such as W/"v1" never satisfies If-Match, even when its opaque value equals the current tag.

When does If-None-Match return 304 instead of 412?

A matching If-None-Match returns 304 for GET or HEAD and 412 for representation-changing methods such as PUT, PATCH or DELETE. CONNECT, OPTIONS, TRACE and the PRI connection preface ignore preconditions.

Which condition wins when ETag and date headers are both present?

If-Match suppresses If-Unmodified-Since, and If-None-Match suppresses If-Modified-Since, matching RFC 9110's required evaluation order.

Standards & references