Httpie: A cURL alternative(github.com)
github.com
Httpie: A cURL alternative
https://github.com/jakubroztocil/httpie
18 comments
It looks cool, but I don't really want to wait half a minute for it to do anything.
On my computer httpie took 0.775s, and curl took 0.105s, so not much slower.
7 times
I use httpie to view request and response headers. Very handy when you want to check something without worrying that a browser is caching something for some reason (like a redirect).
$ http --print Hh http://news.ycombinator.comHttpie is my version of Postman and similar services, curl for humans is spot on imho.
wuzz is nice too. https://github.com/asciimoo/wuzz
I'm just starting to get into Python and using the command line more after a lifetime of mostly sticking to GUIs, and I'm really digging the "software for humans" vibe I'm finding in a few places. HTTPie is a good example, as is ncdu, which I just discovered this morning. Also anything by Kenneth Reitz.
The command line can be great for commanding, when it's done right, but it's not so great for most kinds of visualization, so CLI software that recognizes that and tries to compensate really helps.
The command line can be great for commanding, when it's done right, but it's not so great for most kinds of visualization, so CLI software that recognizes that and tries to compensate really helps.
HTTPie is great! I’ve replaced curl with it in my daily workflow
HTTPie is awesome, the only thing to watch out for is if you use it for large JSON responses, it can take a while to parse, process and display the response. In that case cURL is still handier, but HTTPie is the tool I generally reach for
Depending on what you are doing, Perl's LWP::Simple[1] and plain old wget[2] are sometimes handy.
[1] http://www.perlmonks.org/?node_id=168684
[2] http://www.editcorp.com/personal/lars_appel/wget/v1/wget_7.h...
[1] http://www.perlmonks.org/?node_id=168684
[2] http://www.editcorp.com/personal/lars_appel/wget/v1/wget_7.h...
If you like httpie, http-prompt is a good add on for it, it lets you navigate through a rest API as if it is a filesystem (using cd for navigation), and lets you configure the arguments to pass to httpie for future requests.
Love Httpie! Such an awesome cli with easy to remember, natural syntax. When installing on new boxes I wish it wasn't depending on python though.
Could we all just agree to stop using the adjective “modern”? It’s such a weasal word. If there are advantages to your program, describe them. Simply being “newer” or in the currently trendy style does not make it automatically better.
I’m not saying that this is a bad project. But “modern” doesn’t tell me anything about why I might want to use it.
I’m not saying that this is a bad project. But “modern” doesn’t tell me anything about why I might want to use it.
Well, i use it daily, because it has:
- much more sane command line syntax
- automatic formatting and highlighting of json/xml/html
- automatically show received headers
- reverts to unproccessed output when redirected
PROTIP: use 'cat' to type the body manually:
And if you already have the body in a separate file, just pipe it through:
- much more sane command line syntax
- automatic formatting and highlighting of json/xml/html
- automatically show received headers
- reverts to unproccessed output when redirected
PROTIP: use 'cat' to type the body manually:
cat | http post https://someapi.com/somenendpoint Authorization:sometoken
You can then start typing the message body.
When done, press ctrl+d (EOF) and the request will send and the reply will be printed.And if you already have the body in a separate file, just pipe it through:
cat mybody.json | http post https://someapi.com/somenendpoint Authorization:sometokenDon't need cat for the last one, can you redirected input
http post https://someapi.com/somenendpoint Authorization:sometoken < mybody.jsonAnd if you are like me, you use cat because it can go first in the command line... Until I discovered that file redirects can too!
<mybody.json http post https://someapi.com/somenendpoint Authorization:sometoken
<mybody.json http post https://someapi.com/somenendpoint Authorization:sometoken
OK, we've s/modern//'d the title above.
Can you tell us what you think would be an appropriate 4-6 word tagline for HTTPie?