7.httpie
可以使用curl或httpie测试我们的服务器。Httpie是用Python编写的用户友好的http客户端
安装:pip3 install httpie
#get请求示例 输入命令:http http://127.0.0.1:8000/snippets/ 结果如下: HTTP/1.1 200 OK Content-Length: 354 Content-Type: application/json Date: Sun, 28 Apr 2019 02:53:42 GMT Server: WSGIServer/0.2 CPython/3.7.3 X-Frame-Options: SAMEORIGIN [ { "code": "foo = \"bar\"\n", "id": 1, "language": "python", "linenos": false, "style": "friendly", "title": "" }]
# post请求 http --json POST http http://127.0.0.1:8000/snippets/ #debug模式 http --json POST --debug http http://127.0.0.1:8000/snippets/ #认证 http -a user:password http http://127.0.0.1:8000/snippets/
风月都好看,人间也浪漫.