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

Sets one cookie per query parameter

GEThttps://api.testingapis.com/api/cookies/setSign in to see this endpoint's URL

Example: /api/cookies/set?theme=dark&lang=en sets theme and lang with Path=/. At most 20 cookies; names must be RFC 6265 tokens (1-64 characters) and values at most 256 characters.Example: … sets theme and lang with Path=/. At most 20 cookies; names must be RFC 6265 tokens (1-64 characters) and values at most 256 characters.

Responses

200
The cookies that were set.
400
No query parameters, too many cookies, or an invalid name or value.

Example

Request
curl -X GET "https://api.testingapis.com/api/cookies/set?theme=dark&lang=en" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Set-Cookie: theme=dark; path=/, lang=en; path=/

{"message": "2 cookie(s) set", "set": {"theme": "dark", "lang": "en"}}

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.