Requires If-Match with the current ETag (strong comparison, so W/ tags never match; * matches). A successful update increments the version and returns the new ETag. Use it to test lost-update protection.
Note: Send the current ETag (from GET /api/cache/etag) in If-Match. Missing -> 428, stale -> 412.Note: Send the current ETag (from GET …) in If-Match. Missing -> 428, stale -> 412.
Parameters 1
Name
Type
Description
If-Match
header · string
Current ETag. Missing returns 428, stale returns 412.
Request body
Optional. application/json, text/json, application/*+json, application/xml, text/xml, application/*+xml. Model: CachingControllerDocumentUpdate. New title and/or content.
Example body
{"title":"Updated title","content":"New content"}
Responses
200
Updated; the new ETag is in the header and body.
400
Neither title nor content supplied, or malformed body.
412
If-Match does not match the current ETag.
428
If-Match header missing.
Example
Request
curl-XPUT"https://api.testingapis.com/api/cache/etag"\-H"Content-Type: application/json"\-H"If-Match: "doc-v1""\-d'{"title": "Updated title", "content": "New content"}'\-H"X-TestingApis-Key: YOUR_API_KEY"
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.