
HTTPie: a CLI, cURL-like tool for humans - celadevra_
https://github.com/jkbrzt/httpie
======
alayne
I've been using HTTPie a lot more recently. It really takes the tedium out of
using curl and I can produce color coded output for people. However, I am
still finding myself in situations where I can't figure out how to induce the
correct request. In other words, the user friendliness of being able to do
things like construct JSON from parameters is great until it isn't.

Is there anything similar for GUI users? The standalone application form of
Postman is popular with some coworkers for general HTTP work as is Fiddler on
Windows.

~~~
dordoka
If you are on OS X, you should try Paw [0]. It's like Postman but with native
GUI and lots of options. I use it everyday.

[0] [https://luckymarmot.com/paw](https://luckymarmot.com/paw)

~~~
dperfect
Paw is really nice. I love that you can string together multiple requests with
"dynamic values" (connecting the output from one request to the inputs of
another, with transformations/functions/whatever). I use the command line for
a lot of things, but Charles + Paw is a super powerful combination for
tinkering with HTTP requests outside of code.

------
gamedna
First off, I am really surprised how often this gets re-posted to HN.
[https://hn.algolia.com/?query=httpie&sort=byPopularity&prefi...](https://hn.algolia.com/?query=httpie&sort=byPopularity&prefix&page=0&dateRange=all&type=story)

I discovered HTTPie a few years back and it has completely replaced curl/wget
during our API development and testing.

~~~
zymhan
I guess it's still growing in popularity but hasn't hit the inflection point
of becoming a standard tool.

The concept of an HTTP CLI seems obvious to me in retrospect, but I'm not a
web developer, so maybe there's a reason this isn't as useful it would seem at
first glance?

~~~
jtmarmon
there is an http cli already. it's included in like every OS ever...it's
called curl. httpie is just more user friendly

------
gamedna
Forgot to mention that when dealing with JSON APIs, httpie + jq is a killer
combo.

[https://stedolan.github.io/jq/](https://stedolan.github.io/jq/)

~~~
agumonkey
Reading the docs will probably make people feel all kinds of feelings.
Especially the `last` part.

~~~
Sir_Cmpwn
I don't understand. `echo '[1,2,3,4]' | jq last` seems pretty straightforward
to me and so are the docs.

~~~
agumonkey
I was punning on the fact that the last part of jq's documentation introduces
an almost full fledged functional programming language with function
definition, map etc etc

------
the_common_man
Almost 20k stars. That's quite incredible for a project especially since I
have never heard of it before now.

~~~
stepanhruda
12 minutes later, 23k

------
theaustinseven
I really like this because by default it gives all of the http headers and
makes everything look really nice. Curl still has its place, and I wouldn't
dream of replacing it, but I would definitely use this as a sort of command
line shortcut. Cool project.

~~~
sh4nks
For me it has been incredibly useful for quickly testing some REST APIs.

------
dang
Previously discussed at
[https://news.ycombinator.com/item?id=10418882](https://news.ycombinator.com/item?id=10418882).
More at
[https://hn.algolia.com/?query=HTTPie%20points%3E5&sort=byDat...](https://hn.algolia.com/?query=HTTPie%20points%3E5&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0)

------
steveax
There's also a nice auto-complete utility built on top of HTTPie:

[https://github.com/eliangcs/http-prompt](https://github.com/eliangcs/http-
prompt)

------
paulannesley
I like using HTTPie for many things, however the current release does a bad
job of rendering XML, e.g. it'll display `<sitemapindex
xmlns="[http://…">`](http://…">`) as `<ns0:sitemapindex
xmlns:ns0="[http://…">`](http://…">`). But — I just checked and found the not-
yet-released v1.0.0 fixes this by removing the XML formatter completely as
discussed in
[https://github.com/jkbrzt/httpie/issues/443](https://github.com/jkbrzt/httpie/issues/443)
so my gripe is sorted.

I still tend to go back to cURL when I want to see exactly what's been
received, and use httpie for when I know the response headers and body
serialization are fine and I want to see the data therein.

------
rdtsc
I keep switching between curl + jq vs httpie. Lately I've been using mostly
httpie. It is a great tool. One of my favorite things is it builds json
objects (say for 'put' and 'post' for example) using command line arguments.
So can have:

    
    
        $ http put url key1=val1 key2=val2
    

If one of the fields is a larger nested object can use :=

    
    
        $ http put url key1=simpleval1 key2:='{literaljson...}'

------
pmontra
I don't use this kind of programs all the time (but I did last week) so I
eventually forget that I installed httpie and end up using curl or wget. I
should alias curl to httpie and use \curl for when I really need curl.

------
orliesaurus
One of the first tools I install every time I buy a new machine

------
homero
Incredible

------
partycoder
Right, let's take the human denomination away from people that use cURL...

~~~
NegativeLatency
This tool pops up every few months, not sure why anyone would use it over curl

~~~
scrollaway
Because the syntax is easier to remember, it has syntax highlighting for js,
html and more and it's super easy to send json, form data, headers etc. It's
better and quicker for prototyping APIs for example.

BTW, curl is great too but I hate these kinds of posts. I keep seeing people
on HN saying "not sure why anyone would use Y over X" completely
disingenuously as if they are expressely not acknowledging the legitimate use
cases of Y.

Not sure why anyone would use dropbox over a self-hosted sftp server, right?

~~~
molecule
_> I keep seeing people on HN saying "not sure why anyone would use Y over X"
completely disingenuously as if they are expressely not acknowledging the
legitimate use cases of Y._

Kind of like titling a project "X: a CLI, Y-like tool for humans"...

