basic
httpie 可以在终端查看一个 url 的返回结果
在 ubuntu 中安装 httpie:
$ sudo apt-get update$ sudo apt-get install httpie
使用方法十分简单:
$ http 127.0.0.1
得到:
HTTP/1.1 200 OKConnection: keep-aliveContent-Encoding: gzipContent-Type: text/htmlDate: Mon, 07 Jan 2019 03:38:20 GMTETag: W/"5b46bc18-276"Last-Modified: Thu, 12 Jul 2018 02:25:28 GMTServer: nginx/1.10.3 (Ubuntu)Transfer-Encoding: chunked<!doctype html><html><head><meta charset="utf-8"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><meta name="format-detection" content="email=no"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title></title><link rel="stylesheet" href="/static/umi.92f52983.css"></head><body><div id="root"></div><script>window.routerBase = '/';window.publicPath = '/static/';</script><script src="/static/umi.7a0b20ba.js"></script></body></html>
http methods
http POST :5000/user/login
发送 json
向 localhost:4000/v1/user/login 发送登录请求:
- http method: PUT
- data: json
{email: 'john@qq.com', password: 111111}http --json :4000/v1/user/login email='john@qq.com' password=111111
