test-worker — HTTP request/response testing swiss army knife version: be2d0fbba4041071161d7b1b85c2528485b8fc86 ENDPOINTS / This help text (JSON if Accept: application/json) [GET] /version Deployed git sha and build time [GET] /openapi.json Generated OpenAPI 3.1 document for this deployment [GET] /docs Interactive Swagger UI for the generated OpenAPI document [GET] /status/:code Respond with the given status. Comma list picks one at random (e.g. 200,500,503). ?body= and ?type= set a custom body / content-type /delay/:duration Wait for the duration, then respond 200. Bare numbers are seconds; suffixes ms/s/m allowed (e.g. 30, 1.5s, 250ms). Max 10m /hang Never finish the response. The connection stays open until the client or the edge gives up /flaky/:percent Fail the given percentage of requests (default failure status 500; override with ?status=) /echo Echo the full request (method, url, query, headers, body, client info) as JSON /anything/* Same as /echo, matches any sub-path /get Echo; only GET allowed (405 otherwise) [GET] /post Echo; only POST allowed [POST] /put Echo; only PUT allowed [PUT] /patch Echo; only PATCH allowed [PATCH] /delete Echo; only DELETE allowed [DELETE] /headers Request headers as JSON /ip Client IP as plain text /user-agent Request User-Agent as plain text /method Request method as plain text /json Sample JSON document /html Sample HTML page /xml Sample XML document /text Sample plain text /image/png 1x1 transparent PNG /image/svg Sample SVG image /uuid A random UUID v4 /now Current server time /bytes/:n n random bytes (application/octet-stream). ?fill=x repeats a single character instead of random. Max 10 MiB /stream/:n Stream n newline-delimited JSON chunks. ?interval= waits between chunks (default 0). Max 10000 chunks /drip Trickle ?bytes= (default 10) over ?duration= (default 2s), with ?status= (default 200) /response-headers Set each query param as a response header (e.g. ?X-Foo=bar&X-Baz=1); body lists them /redirect/:n Chain of n redirects ending at /get. ?status= sets the redirect code (default 302); ?absolute=1 uses absolute URLs /redirect-to Redirect to ?url= with ?status= (default 302) /cache/:duration Cacheable response with Cache-Control max-age for the duration (0 = no-store), ETag and Last-Modified. Honours If-None-Match / If-Modified-Since with 304 /cookies Request cookies as JSON /cookies/set Set each query param as a cookie (e.g. ?session=abc&theme=dark), then redirect to /cookies /cookies/delete Expire each named query param cookie (e.g. ?session&theme), then redirect to /cookies /basic-auth/:user/:pass HTTP Basic auth; 401 unless credentials match /bearer Bearer auth; 401 unless an Authorization: Bearer token is present (?token= requires a specific value) GLOBAL QUERY PARAMS (work on every endpoint) ?delay Wait before responding (e.g. ?delay=3 or ?delay=250ms). Bare numbers are seconds. Max 10m ?status Override the response status (e.g. ?status=503 or ?status=200,500 for a random pick) ?header Add a response header, repeatable (e.g. ?header=X-Foo:bar&header=Retry-After:5) ?cors CORS headers are sent by default; ?cors=0 disables them EXAMPLES /status/500 -> HTTP 500 /status/200?delay=30 -> HTTP 200 after 30 seconds /status/200,500,503 -> random one of those /delay/1.5s -> HTTP 200 after 1.5 seconds /json?status=429&header=Retry-After:10 /stream/10?interval=500ms -> 10 ndjson lines, one every 500ms /drip?bytes=100&duration=10s -> 100 bytes trickled over 10 seconds /anything/foo/bar?x=1 (POST) -> echo of your request Every response carries X-Git-Sha and X-Request-Id headers.