httpbin README

项目的 README,来自 github.com/postmanlabs/httpbin。合并为一个 markdown 文件:README.md。

httpbin(1): HTTP Request & Response Service

A Kenneth Reitz Project.

ice cream

httpbin is a small web service for testing HTTP clients. It echoes back what you send (headers, query, body, files, cookies, your IP) and answers on demand with the status code, delay, redirect, compression, auth challenge or data you ask for, so you can check how your code behaves against each of them. It is what runs at http://httpbin.org.

This project does not publish releases or Docker images. To run your own copy, build it from this repository:

git clone https://github.com/postmanlabs/httpbin.git
cd httpbin
docker build -t httpbin . && docker run -p 80:8080 httpbin

See http://httpbin.org for more information.

To limit where /redirect-to may send clients, set ALLOWED_REDIRECT_DOMAINS to a comma-separated list of hosts, for example docker run -p 80:8080 -e ALLOWED_REDIRECT_DOMAINS=example.com,example.org httpbin.

Running the tests

pip install --require-hashes -r requirements-test.txt
python test_httpbin.py

To run the tests against any running httpbin instead of the in-process app, set its base URL. Tests that need the in-process app are skipped.

HTTPBIN_TEST_TARGET_URL=http://localhost:8080 python test_httpbin.py

Officially Deployed at:

SEE ALSO

Build Status

test

httpbin (postmanlabs/httpbin)

正在搜索数据库…

这是什么?一个 HTTP 请求和响应服务:一个可以接收请求并查看响应的 Web API,很适合用来测试 HTTP 客户端。它用 Python 和 Flask 编写。
它是导入到代码里的库,还是可以发送真实 HTTP 请求的服务?是服务,不是库:它以 HTTP 服务器的形式运行,所以任何 HTTP 客户端——curl、浏览器、任何语言写的代码——都能和它通信。
怎么运行自己的副本?README 里链接了 Run Locally 部分,而且仓库自带 Dockerfile 和 docker-compose 配置,所以你可以直接运行 Flask 应用,也可以用 Docker Compose 启动。
自己部署的话,需要先配置好 Python 环境吗?只有走本地方式才需要,因为它是 Python + Flask 应用。如果用自带的 Docker 或 docker-compose 配置,Python 及其依赖都留在容器里。
不安装任何东西能试用吗?可以——README 里给出了官方部署的公开实例,你可以立刻通过网络发送请求开始使用。
httpbin 还在活跃开发吗?它诞生于 2011 年,没有被归档,现在归在 Postman Labs 的 GitHub 组织下,大约有 13.6k 颗星——一个老牌但很有名的项目。
有哪些类似的项目?nock, reclip, sanic, iptv-api, livego, cli, FractalCore, proxy_pool
大小
1.5 MB
星标
13.6K
时长
15年
提交 · 90 天