A simple Python/Flask based webserver that echos back any incoming requests.
261
A simple Python/Flask based webserver that echos back any incoming requests.
docker build -t echo-server:latest .
| Variable name | Default value | Description |
|---|---|---|
BIND_ADDRESS | 0.0.0.0 | Which host address to listen on. |
OUTPUT | json | The format to return HTTP responses. Can be JSON or YAML. |
docker run --rm -d -p 5000:5000 echo-server:latest
curl -X POST 'http://localhost:5000/some/path/test?my_key=a_value&foo=bar' -d 'hello world' | jq
Should return:
{
"args": {
"foo": "bar",
"my_key": "a_value"
},
"client_ip": "172.17.0.1",
"data": "hello world",
"headers": {
"Accept": "*/*",
"Content-Length": "11",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "localhost:5000",
"User-Agent": "curl/7.74.0"
},
"method": "POST",
"response_time": 0.0002567768096923828,
"timestamp": "2023-04-10 09:45:49.595615",
"uri": "/some/path/test"
}
Content type
Image
Digest
sha256:2513b85bd…
Size
22.3 MB
Last updated
over 1 year ago
docker pull maze88/echo-server