salt-httpbin-origin

v0.1.0

An httpbin.io-compatible HTTP request & response service, running on AWS Lambda behind an API Gateway HTTP API. Built as a proxyable origin for Cloudflare and Salt traffic-collector testing. Response shapes follow go-httpbin: args, form and headers are multi-valued, and origin honours CF-Connecting-IP.

Request inspection

GET /get Returns the request's query args, headers, origin and URL.
POST /post Returns the POST request's body, form fields, args and headers.
PUT /put Returns the PUT request's body, form fields, args and headers.
PATCH /patch Returns the PATCH request's body, form fields, args and headers.
DELETE /delete Returns the DELETE request's body, form fields, args and headers.
ANY /anything Returns the request data for any HTTP method.
ANY /anything/* Returns the request data for any method and any sub-path.
GET /headers Returns the inbound request headers.
GET /ip Returns the caller's origin IP address.
GET /user-agent Returns the caller's User-Agent header.
GET /json Returns a sample JSON document.
GET /xml Returns a sample XML document.
GET /html Returns a sample HTML document.
GET /robots.txt Returns a robots.txt.
GET /deny Returns page denied by robots.txt rules.

Status codes

ANY /status/:codes Returns the given status code, or one sampled from a weighted list.
GET /delay/:seconds Delays the response by up to 20s.
GET /drip Drips data over a duration, after an optional initial delay.

Auth

GET /basic-auth/:user/:passwd Challenges HTTP Basic auth and validates the credentials.
GET /hidden-basic-auth/:user/:passwd Like /basic-auth but returns 404 instead of a 401 challenge.
GET /bearer Validates a Bearer token and echoes it back.
GET /digest-auth/:qop/:user/:passwd Challenges HTTP Digest auth (MD5).
GET /digest-auth/:qop/:user/:passwd/:algorithm Challenges HTTP Digest auth with an explicit algorithm.

Redirects

GET /redirect/:n 302-redirects n times (max 20).
GET /relative-redirect/:n Redirects n times using a relative Location header.
GET /absolute-redirect/:n Redirects n times using an absolute Location header.
GET POST /redirect-to Redirects to the given url= with an optional status_code=.

Dynamic data

GET /uuid Returns a random UUID v4.
GET /base64/:value Decodes a base64url-encoded string.
GET /bytes/:n Returns n random bytes (max 4194304).
GET /stream-bytes/:n Returns n bytes; buffered by API Gateway rather than chunked.
GET /stream/:n Returns n newline-delimited JSON objects.
GET /range/:n Supports HTTP Range requests over n generated bytes.
GET /links/:n/:offset Returns a page of n interlinked HTML links.
GET /gzip Returns a gzip-encoded response body.
GET /deflate Returns a deflate-encoded response body.
GET /brotli Returns a br-encoded response body.
GET /etag/:etag Serves an ETag and honours If-None-Match / If-Match.
GET /hash/:algorithm Hashes value= (or the body) with md5/sha1/sha256/sha512.

Cookies

GET /cookies Returns the cookies sent by the client.
GET /cookies/set Sets cookies from the query string, then redirects to /cookies.
GET /cookies/set/:name/:value Sets a single named cookie, then redirects to /cookies.
GET /cookies/delete Deletes the named cookies, then redirects to /cookies.

Response inspection

GET POST /response-headers Returns the query parameters as response headers.
GET /cache Returns 304 for conditional requests, 200 otherwise.
GET /cache/:seconds Sets a Cache-Control max-age of n seconds.
GET /encoding/utf8 Returns a UTF-8 encoded HTML document.
GET /image Returns an image matching the Accept header.
GET /image/png Returns a PNG image.
GET /image/jpeg Returns a JPEG image.
GET /image/webp Returns a WebP image.
GET /image/svg Returns an SVG image.
GET /forms/post An HTML form that POSTs to /post.

Meta

GET / This page — lists every available endpoint.
GET /healthz Health check.
GET /spec.json A minimal OpenAPI description of these endpoints.