Situatie
HTTPie (pronounced aitch-tee-tee-pie) is a cURL-like, modern, user-friendly, and cross-platform command line HTTP client written in Python. It is designed to make CLI interaction with web services easy and as user-friendly as possible.
Solutie
Most Linux distributions provide a HTTPie package that can be easily installed using the default system package manager, for example:
Once installed, the syntax for using httpie is:
The most basic usage of httpie is to provide it a URL as an argument:
Now let’s see some basic usage of httpie command with examples.
You can send a HTTP method in the request, for example, we will send the GET method which is used to request data from a specified resource. Note that the name of the HTTP method comes right before the URL argument.
This example shows how to upload a file to transfer.sh using input redirection.
You can download a file as shown.
You can find more usage examples from the HTTPie Github repository: https://github.com/jakubroztocil/httpie
HTTPie is a cURL-like, modern, user-friendly command line HTTP client with simple and natural syntax, and displays colorized output. In this article, we have shown how to install and use httpie in Linux. If you have any questions, reach us via the comment form below.
Leave A Comment?