HTTP Immediate – An Interactive Command Line HTTP Consumer
HTTP Immediate (or HTTP-prompt) is an interactive command-line HTTP consumer constructed on HTTPie and prompt_toolkit, that includes autocomplete and syntax highlighting. It additionally helps auto cookies, OpenAPI/Swagger integration in addition to Unix-like pipelines and output redirection. As well as, it comes with greater than 20 themes that you should use.
On this article, we’ll clarify tips on how to set up and briefly use HTTP-prompt in Linux.
How one can Set up HTTP Immediate in Linux
You possibly can set up HTTP-prompt similar to an everyday Python package deal utilizing PIP command as proven.
$ pip set up http-prompt
You’ll seemingly get some permission errors in case you are making an attempt to put in HTTP-prompt on the system-wide Python. It isn’t suggested, but when that is what you wish to do, simply use sudo command to realize root privileges as proven.
$ sudo pip set up http-prompt
Alternatively, you should use the –user possibility to put in the package deal into person house listing as follows:
$ pip set up –user http-prompt
To improve HTTP Immediate, do:
$ pip set up -U http-prompt
How one can Use HTTP Immediate in Linux
To begin a session, merely run the http-prompt command as proven.
Begin with the final session or http://localhost:8000
Begin with the given URL
$ http-prompt http://localhost:3000
Begin with some preliminary choices
$ http-prompt localhost:3000/api –auth person:go username=anyone
After beginning a session, you’ll be able to kind instructions interactively as proven within the following screenshot.
To preview how HTTP Immediate goes to name HTTPie, run the next command.
> httpie put up
You possibly can ship an HTTP request, enter one of many HTTP strategies as proven.
> put up
It’s attainable so as to add headers, query-string, or physique parameters, use the syntax as in HTTPie. Listed here are some examples:
# set header
> Content material-Sort:utility/json
# querystring parameter
> web page==5
# physique parameters
> full_name=’Tecmint HowTos’
# physique parameters in uncooked JSON
# write the whole lot in a single line
> Content material-Sort:utility/json web page==5 username=tecmint
It’s also possible to add HTTPie choices as proven.
> –form –auth person:go
> –form –auth person:go username=tecmint Content material-Sort:utility/json
To reset the session (clear all parameters and choices) or exit a session, run:
> rm * #reset session
> exit #exit session
For extra data and utilization examples, see the HTTP-prompt documentation at: http://http-prompt.com/.
That’s all! HTTP Immediate makes an ideal companion for HTTPie. We’d love to listen to from you. Share your ideas or ask questions on HTTP-prompt by way of the suggestions kind beneath.