gitmyhub

httpbin

Python ★ 14k updated 2y ago

HTTP Request & Response Service, written in Python + Flask.

Httpbin is a web service that accepts any HTTP request and returns a JSON description of what it received, headers, body, query parameters, IP, with no side effects, making it ideal for debugging HTTP clients.

PythonFlaskDockersetup: easycomplexity 2/5

Httpbin is a web service that accepts HTTP requests and returns structured responses describing what it received. Developers use it to test HTTP client code, debug how a tool formats its requests, or experiment with specific HTTP behaviors in isolation. The service itself does nothing with the request beyond inspecting it: it reads the headers, query parameters, form data, request body, IP address, and other properties, then returns that information as JSON. There is no database, no authentication, and no side effects.

The server is written in Python using Flask, a lightweight web framework. Running it locally takes two commands using Docker: pull the image and start a container on port 80. No configuration files or environment variables are required beyond that.

A publicly hosted version of the service has historically been available at httpbin.org, which allows developers to send test requests without running anything locally. This makes it convenient for quick debugging of HTTP client libraries, checking what headers a browser sends, or verifying the behavior of a network proxy.

The README is very short, under 700 characters, and lists only the two Docker commands plus links to the live service and two related tools. It does not document the available endpoints. The full set of capabilities, which typically includes routes for testing redirects, cookies, authentication headers, request delays, streaming responses, response compression, and specific HTTP status codes, would need to be discovered by visiting the live site or reading the source code.

The project is associated with Postman Labs and was originally created by Kenneth Reitz, who also created the Python Requests library. The README references two related services: requestb.in for inspecting incoming webhooks and grpcb.in for testing gRPC requests.

Where it fits