httpbin.org 这个网站能测试 HTTP 请求和响应的各种信息,比如 cookie、ip、headers 和登录验证等,且支持 GET、POST 等多种方法,对 web 开发和测试很有帮助。
它用 Python + Flask 编写,是一个开源项目。
httpbin.org 网站
官方网站:http://httpbin.org/
开源地址:https://github.com/Runscope/httpbin
1、https://httpbin.org/headers 返回headers信息
{ "headers": { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9", "Host": "httpbin.org", "Referer": "https://blog.csdn.net/Hubz131/article/details/89157089", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36", "X-Amzn-Trace-Id": "Root=1-5e5bb674-cac5f0c038da9abaa915715f" } }
2、https://httpbin.org/ip返回你使用的访问此链接的IP地址
{ "origin": "128.33.232.66" }
3、https://httpbin.org/user-agent返回USER-AGENT信息
{ "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36" }
4、http://httpbin.org/get?show_env=1返回更为详细的信息(被图掉部分为IP)
{ "args": { "show_env": "1" }, "headers": { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9", "Host": "httpbin.org", "Referer": "https://blog.csdn.net/Hubz131/article/details/89157089", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36", "X-Amzn-Trace-Id": "Root=1-5e5bb727-e16e30e1a5f3a8017ed01593", "X-Forwarded-For": "128.39.222.68", "X-Forwarded-Port": "80", "X-Forwarded-Proto": "http" }, "origin": "128.39.222.68", "url": "http://httpbin.org/get?show_env=1" }
未经允许请勿转载:程序喵 » httpbin.org 的使用