Simple HTTP service that echo back the request info to the client
806
This is a simple HTTP service that echo back the request info to the client. A simple debugging tool in some container environment.
# start the service with docker in the foreground
$ docker run -i -p 8080:8080 pahud/echo-http-request:latest
# switch to another terminal and test it with cURL
$ curl -s localhost:8080 | jq
{
"body": "",
"headers": {
"accept": "*/*",
"host": "localhost:8080",
"user-agent": "curl/7.61.1"
},
"host": "localhost:8080",
"httpMethod": "GET",
"path": "/",
"queryStringParameters": {},
"uri": "/"
}
You will see the header, host and uri in the response JSON.
You may also run it with OpenResty
# OpenResty
$ docker run -i -p 8080:80 pahud/echo-http-request:openresty
# switch to another terminal and test it with cURL
$ curl -s localhost:8080 | jq
{
"queryStringParameters": {},
"path": "/",
"httpMethod": "GET",
"headers": {
"host": "localhost:8080",
"accept": "*/*",
"user-agent": "curl/7.61.1"
},
"body": ""
}
Content type
Image
Digest
Size
10.4 MB
Last updated
over 7 years ago
docker pull pahud/echo-http-request