This is an HTTPBin server that helps you debug HTTP requests
1.1K
HTTPBin is a server that helps you debug HTTP requests.
This application expects to receive the following environment variables:
You can determine the server's behavior for a specific request-response cycle by sending predefined configuration headers, as follows:
Header: X-HttpBin-Status
Description: Specifies the status code of the response.
Header: X-HttpBin-Sleep
Description: Specifies a response delay in seconds.
Header: X-HttpBin-Content-Type
Description: Requests with payloads must declare a content type that matches the one accepted by the server, otherwise the server will return a 415 (Unsupported Media Type) status code.
Use the special path "/proxy" with the query param "to" to set the destination to which the request should be proxied. The response replicates the headers and body the destination server returns.
curl -i "http://localhost:8888/proxy?to=https://google.com"
Use the special path "/health" to check service health. It returns a simple 200 status code when the service is up and ready.
curl -i "http://localhost:8888/health"
docker run --rm -p 8080:8888 michelfortes/httpbin
A JSON containing information about the request and the Container where the application is running.
Conteúdo do arquivo payload.json:
{
"name": "John Doe",
"email": "[email protected]"
}
curl -i -H "Content-Type: application/json" -X POST "localhost:8888/some-path?fruits=apple&fruits=orange&drink=juice" -d @payload.json
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 09 Jan 2024 13:41:57 GMT
Content-Length: 340
{
"serviceId": "container-01",
"remoteAddr": "127.0.0.1:57968",
"method": "POST",
"path": "/some-path",
"queryParams": {
"drink": [
"juice"
],
"fruits": [
"apple",
"orange"
]
},
"headers": {
"Accept": [
"*/*"
],
"Content-Length": [
"60"
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"curl/8.7.1"
]
},
"payload": "{ \"name\": \"John Doe\", \"email\": \"[email protected]\" }"
}
Content type
Image
Digest
sha256:ea29aa7dc…
Size
12.9 MB
Last updated
10 months ago
docker pull michelfortes/httpbin