Rucho

`/cache/:n` — returns `200` with `Cache-Control: public, max-age=n`.

get
https://rucho.org/cache/{n}

Path Parameters

ninteger(int64)required

>= 0

Response

200

JSON echo with Cache-Control: public, max-age=n

get/cache/{n}
 
200

Returns all cookies from the request as JSON.

Parses the Cookie header and returns a JSON object with a cookies key
containing a map of cookie name-value pairs.

Example Response

{ "cookies": { "session": "abc123", "theme": "dark" } }
get
https://rucho.org/cookies

Response

200 application/json

Returns all cookies from the request

get/cookies
 
200 application/json

Deletes cookies via the `DELETE` method on `/cookies` — RESTful symmetry with

GET /cookies/delete. Each query-parameter name expires the matching cookie
(Max-Age=0), and the response is a 302 redirect to /cookies.

Example

DELETE /cookies?foo&theme expires both cookies and redirects.

delete
https://rucho.org/cookies

Query Parameters

objectrequired

Cookie names to delete

Response

302

Redirects to /cookies after deleting cookies

delete/cookies
 
302

Deletes cookies by setting `Max-Age=0` and redirects to `/cookies`.

Each query parameter name is used to expire the corresponding cookie.
The value of the query parameter is ignored.

Example

GET /cookies/delete?foo&theme expires both cookies and redirects.

get
https://rucho.org/cookies/delete

Query Parameters

objectrequired

Cookie names to delete

Response

302

Redirects to /cookies after deleting cookies

get/cookies/delete
 
302

Sets cookies from query parameters and redirects to `/cookies`.

Each non-reserved query parameter becomes a Set-Cookie response header.
Reserved keys add attributes applied to every cookie set in the request:
secure, httponly, samesite=<Strict|Lax|None>, max_age=<seconds>,
path=<path> (default /), domain=<domain>. After setting the cookies,
responds with a 302 redirect to /cookies so the client can see the result.

Example

GET /cookies/set?session=abc&secure&httponly&samesite=Strict&max_age=3600
sets session=abc; Path=/; Max-Age=3600; SameSite=Strict; Secure; HttpOnly.

get
https://rucho.org/cookies/set

Query Parameters

objectrequired

Cookie name=value pairs, plus optional attribute flags: secure, httponly, samesite, max_age, path, domain

Response

302

Redirects to /cookies after setting cookies

get/cookies/set
 
302