HTTP interface debugging tool! 48000 star HTTP command line client!

Open source outpost 2021-02-23 00:06:30
http interface debugging tool star


【 Introduction 】:Python Realized HTTP Request the command line client , I understood as a curl Of Python edition , But it provides a more friendly , Easier to use commands and options .
brief introduction

HTTPie It's using Python Realized HTTP Command line tools , Provides a more humane 、 More interactive commands and options , It can be used for testing 、 Debugging and communication with HTTP API Server interaction ,http and https The command can be used to send any http request , Use natural and simple grammar , Provides formatting and color output .

HTTPie It has the following main features :

1、 Natural and intuitive grammar

2、 Formable terminal output , Including color discrimination

3、 Support JSON

4、 Support form and file upload

5、 Support HTTPS、 Proxy and authentication

6、 You can send any request data

7、 Custom request header

8、 Session persistence

9、 similar wget Download function

10、 Support Linux、macOS and Windows

11、 Support plug-ins

12、 Perfect documentation support

Download and install

Project source address :

https://github.com/httpie/httpie

Project test

demo:https://httpie.io/run

Operating environment requirements Python3.6 Version and above .Windows The installation on the platform needs to ensure that setuptools The version is the latest , Use the following command to install :

$ pip install --upgrade pip setuptools
$ pip install --upgrade httpie

For installation methods on other platforms, refer to readme that will do , It's very clear . meanwhile ,HTTPie Our website also provides a tool , It can be executed directly on the browser HTTPie command , For tasting 、 It's easy to test .

Easy to use

Let's take a look at some examples from the official website HTTPie Usage of .

1、 This command means , To address httpbin.org send out PUT request , The custom request header is X-API-Token:123, The request data format is JSON, The specific key value is name=John. It can be seen from this example that ,http The command is followed by the request method (PUT、DELETE、POST etc. ), The custom request header uses XX:YY The format of ,JSON The data used XX=YY Express .

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

The execution result is :

2、 This command means , To address httpbin.org Send as a form POST request ,-f Options indicate that the data is submitted in the form format .

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

The execution result is :

3、 This command means , To address httpbin.org send out GET request ,-v Represents the output of the entire HTTP Request response data exchanged ( There are other options as well , such as —headers,-h Print only response headers ,--body,-b Print only response data ). If the request method is not explicitly specified , When no data is sent , The default is GET Method , When there is data to send , The default is POST Method .

http -v httpbin.org/get

The execution result is :

4、 This command means , Send... To the destination address POST request . We know github You need login authentication , This is also -a(--auth) The function of this option ,-a Followed by the user name , During the execution of the following command , Will interactively ask you to enter your password .

http -a USERNAME POST https://api.github.com/repos/httpie/httpie/issues/83/comments body='HTTPie is awesome! :heart:'

The execution process is :

5、 This command means , To address httpbin.org Upload files data.json, The redirection symbol is used as the file input .

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

Accordingly , An example of downloading a file and redirecting it to local storage is as follows :

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

The above are some simple examples provided on the official website , however HTTPie It's a lot more than that , such as mutipart/form-data File upload of 、HTTP Proxy forwarding 、 Block transmission 、HTTPS Certificate validation of 、 Appoint SSL edition 、 Format output and many other common 、 Useful features , For those who often need debugging HTTP Network students , It's definitely a good tool , comparison curl, Its commands and options are more friendly , Please refer to the official documents , Try it yourself .

Open source outpost Everyday sharing is hot 、 Interesting and practical open source projects . Participate in maintenance 10 ten thousand + Star Open source technology repository for , Include :Python、Java、C/C++、Go、JS、CSS、Node.js、PHP、.NET etc. .
版权声明
本文为[Open source outpost]所创,转载请带上原文链接,感谢
https://qdmana.com/2021/02/20210222153512811l.html

  1. 【微前端】微前端最终章-qiankun指南以及微前端整体探索
  2. Vue-Cli 创建vue3项目
  3. Go in the front of the progress of u boot v7.0 U disk boot disk production tools
  4. 使用NTLM的windows身份验证的nginx反向代理
  5. Rust教程:针对JavaScript开发人员的Rust简介
  6. 使用 Serverless Framework 部署个人博客到腾讯云
  7. #研發解決方案#易車前端監控系統
  8. Vue changes localhost to IP address and cannot access
  9. JavaScript进阶学习
  10. HTML5 from entry to proficient, realize annual salary 10W +, zero basic students must see
  11. Vue:vuex状态数据持久化插件vuex-persistedstate
  12. Vue source code analysis - start
  13. Vue -- the child component calls the method of the parent component and passes parameters --- props
  14. React-Native 获取设备当前网络状态 NetInfo
  15. 高性能 Nginx HTTPS 调优 - 如何为 HTTPS 提速 30%
  16. How to learn HTML5? How can Xiaobai start HTML5 quickly?
  17. HTML + CSS detailed tutorial, this article is enough, but also quickly save
  18. JavaScript高级:JavaScript面向对象,JavaScript内置对象,JavaScript BOM,JavaScript封装
  19. Why Vue uses asynchronous rendering
  20. JavaScript高级:JavaScript面向对象,JavaScript内置对象,JavaScript BOM,JavaScript封装
  21. vue判断elementui中el-form是否更新变化,变化就提示是否保存,没变就直接离开
  22. 算法题:两数之和——JavaScript及Java实现
  23. 高性能 Nginx HTTPS 调优
  24. Why Vue uses asynchronous rendering
  25. day 31 jQuery进阶
  26. day 30 jQuery
  27. CSS whimsy -- using background to create all kinds of wonderful backgrounds
  28. Why are more and more people learning front end?
  29. What do you do with 4K front-end development?
  30. 8 years of front-end development knowledge precipitation (do not know how many words, keep writing it...)
  31. What is the annual salary of a good web front end?
  32. Front end novice tutorial! How to get started with web front end
  33. Will the front end have a future?
  34. Is the front end hard to learn?
  35. Seven new Vue combat skills to improve efficiency in 2021!
  36. Is front end learning difficult?
  37. How about the process of Web front-end development and self-study?
  38. Front end learning route from zero basis to proficient
  39. What is the basis of learning front end?
  40. What knowledge points need to be learned for self-study front end? How long can I become a front-end Engineer?
  41. An inexperienced front-end engineer, what are the common problems when writing CSS?
  42. HttpServletRequest get URL (parameter, path, port number, protocol, etc.) details
  43. Springboot starts http2
  44. Enabling http2.0 in spring boot
  45. JQuery:JQuery基本语法,JQuery选择器,JQuery DOM,综合案例 复选框,综合案例 随机图片
  46. Using JavaScript in Safari browser history.back () the page will not refresh after returning to the previous page
  47. vue.js Error in win10 NPM install
  48. In less than two months, musk made more than $1 billion, more than Tesla's annual profit
  49. Springboot starts http2
  50. Vue event bus
  51. JQuery easy UI tutorial: custom data grid Pagination
  52. Using okhttp and okhttpgo to obtain onenet cloud platform data
  53. Vue3 component (IX) Vue + element plus + JSON = dynamic rendering form control
  54. HTTP 1. X learning notes: an authoritative guide to Web Performance
  55. Vue3 component (IX) Vue + element plus + JSON = dynamic rendering form control
  56. HTTP 1. X learning notes: an authoritative guide to Web Performance
  57. JQuery:JQuery基本语法,JQuery选择器,JQuery DOM,综合案例 复选框,综合案例 随机图片
  58. Event bubble and capture in JavaScript
  59. The root element is missing solution
  60. Event bubble and capture in JavaScript