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

Returns a greeting in the language chosen by Accept-Language

GEThttps://api.testingapis.com/api/cache/varySign in to see this endpoint's URL

Reads Accept-Language (quality values honoured) and supports en, es, fr, de and hi, falling back to en. Sets Vary: Accept-Language and Content-Language. Example: Accept-Language: fr-CA, es;q=0.9 gives French.

Parameters 1

NameTypeDescription
Accept-Languageheader · stringen, es, fr, de or hi.

Responses

200
The chosen language and greeting.

Example

Request
curl -X GET "https://api.testingapis.com/api/cache/vary" \
  -H "Accept-Language: fr" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Cache-Control: public, max-age=60
Vary: Accept-Language
Content-Language: fr

{
  "language": "fr",
  "greeting": "Bonjour, bienvenue sur TestingAPIs !",
  "supported": ["en", "es", "… 3 more items"]
}

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.