Automation and Artificial Intelligence

A RESTCONF client reads a resource with ETag "r17", then sends an update with If-Match: "r17" after another client changes the resource. The server returns HTTP 412; what is the BEST interpretation?

Show the answer

Correct answerC. The update failed because its resource version was stale.

AWhy not this: HTTP 412 reports a failed precondition, not successful completion without content.

BWhy not this: An unsupported request media type is indicated by HTTP 415, not this failed conditional update.

CWhy this is right: Another change invalidated the supplied ETag, so the If-Match precondition failed.

DWhy not this: The decisive detail is the changed resource version, not evidence that the resource is missing.

HTTP 412 Precondition Failed means the If-Match condition was not satisfied: the resource no longer matched the supplied ETag. A missing resource is associated with HTTP 404, not the stale-version condition described here.