httpbin
httpbin/standalone
HTTP request and response service for testing gateways and clients with zero setup
Deploys go-httpbin , a Go implementation of the httpbin API, into a local Kind cluster. Every endpoint answers without configuration: echo requests, force status codes, add latency, stream responses, and exercise auth schemes. Use it as the upstream for e2e tests that check what a gateway or client sends and how it reacts to known responses.
- Endpoint:
http://localhost:31880from the host,http://httpbin:8080from inside the cluster. - Web UI listing every endpoint:
http://localhost:31880.
Need an upstream that misbehaves in scripted, per-test ways instead? Use
mockserver/standalone.
Install gck#
go install github.com/gravitee-io-labs/gck@latest
For other installation methods, see Installation .
Usage#
Create#
gck create --from httpbin/standalone
Cleanup#
gck delete
Quick Start#
Echo back the method, headers, query and body of any request:
curl -s -X POST 'http://localhost:31880/anything/some/path?q=1' \
-H 'X-Test: hello' -d '{"key":"value"}'
Force a status code, or pick one at random from a weighted list:
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:31880/status/503
curl -s -o /dev/null -w '%{http_code}\n' 'http://localhost:31880/status/200:0.8,503:0.2'
Add latency to test timeouts:
curl -s http://localhost:31880/delay/3
Other useful endpoints: /headers, /ip, /basic-auth/{user}/{pass},
/bearer, /redirect/{n}, /stream/{n}, /sse, /websocket/echo and
/hostname. See the
go-httpbin documentation
for the full list.
Endpoints
Services this context exposes on your machine after gck create, including the ones it inherits from the contexts it composes. Rows marked with a flag only exist when you pass it; rows marked with an alternative only exist when it is selected, and rows marked not with one disappear when it is.
| Service | URL | Notes | From |
|---|---|---|---|
| httpbin | http://localhost:31880 | http://httpbin:8080 in-cluster | httpbin/standalone |
Variables
Template variables overridable with --set. Use --set path.segments.var=value to target a specific context in the composition chain.
| Variable | Default | Origin | Description |
|---|---|---|---|
clusterName | httpbin-standalone | httpbin/standalone | Name of the Kind cluster |
imageRepository | mccutchen/go-httpbin | httpbin/standalone | go-httpbin Docker image repository |
imageTag | 2.25.0 | httpbin/standalone | go-httpbin Docker image tag |