TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Returns the versioned document with its ETag

GETHEADhttps://api.testingapis.com/api/cache/etagSign in to see this endpoint's URL

Reads If-None-Match: when it matches the current ETag (weak comparison, * matches anything), the response is 304 with no body. The ETag has the form "doc-v{version}". Also answers HEAD.

Note: Send the returned ETag back in If-None-Match to get 304 Not Modified.

Parameters 1

NameTypeDescription
If-None-Matchheader · stringETag from a previous response; a match returns 304 Not Modified.

Responses

200
The document, with ETag and Cache-Control: no-cache.
304
The client's copy is current.

Example

Request
curl -X GET "https://api.testingapis.com/api/cache/etag" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
ETag: "doc-v1"
Cache-Control: no-cache

{
  "id": 1,
  "version": 1,
  "title": "TestingAPIs cached document",
  "content": "Send If-None-Match to get a 304, and If-Match on PUT to make a conditional update.",
  "updatedAt": "2025-01-01T00:00:00Z",
  "etag": "\"doc-v1\""
}

Sign in to see the details

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.