httpie参考

参考サイト

httpie.org qiita.com

サンプル

HTTPIE - GET

>  http http://httpbin.org/get

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 258
Content-Type: application/json
Date: Sat, 03 Feb 2018 03:51:34 GMT
Server: meinheld/0.6.1
Via: 1.1 vegur
X-Powered-By: Flask
X-Processed-Time: 0.000632047653198

{
    "args": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate",
        "Connection": "close",
        "Host": "httpbin.org",
        "User-Agent": "HTTPie/0.9.9"
    },
    "origin": "153.229.101.173",
    "url": "http://httpbin.org/get"
}

HTTPIE - POST

> http http://httpbin.org/post X-API-Token:123 namd=John

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 477
Content-Type: application/json
Date: Sat, 03 Feb 2018 03:48:29 GMT
Server: meinheld/0.6.1
Via: 1.1 vegur
X-Powered-By: Flask
X-Processed-Time: 0.00128102302551

{
    "args": {},
    "data": "{\"namd\": \"John\"}",
    "files": {},
    "form": {},
    "headers": {
        "Accept": "application/json, */*",
        "Accept-Encoding": "gzip, deflate",
        "Connection": "close",
        "Content-Length": "16",
        "Content-Type": "application/json",
        "Host": "httpbin.org",
        "User-Agent": "HTTPie/0.9.9",
        "X-Api-Token": "123"
    },
    "json": {
        "namd": "John"
    },
    "origin": "153.229.101.173",
    "url": "http://httpbin.org/post"
}