Linux httpie

httpie的官网

httpie的官网
https://httpie.org/

httpie的下载

  1. $ yum install httpie

httpie的使用

①自定义的HTTP方法,请求和json数据

  1. $ http PUT httpbin.org/put X-API-Token:123 name=John

②提交表单

  1. $ http -f POST httpbin.org/post hello=World

③查看正在发送的请求

  1. $ http -v httpbin.org/get

④上传文件

  1. $ http httpbin.org/post < files/data.json

⑤下载文件并重定向到指定目录文件

  1. $ http httpbin.org/image/png > image.png

⑥使用session会话

  1. $ http --session=logged-in -a username:password httpbin.org/get API-Key:123