Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't that the same as curl(1)?


Nope. HTTPie is much, much more focused than cURL (the CLI tool). It is exclusively an HTTP client designed primarily for interactive use. cURL, on the other hand, is meant to be used mostly non-interactively and is more of a general client for "URLs" (it also supports DICT, FILE, FTP, FTPS, GOPHER, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).

HTTPie's goal is user-friendliness, so it comes with features like built-in JSON support, output formatting, syntax highlighting, extensions, etc. Comparison of the two in one screenshot can be seen in the README:

https://github.com/jakubroztocil/httpie#readme

(Disclaimer: I created HTTPie)


I use and love httpie but I start to regret that it's written in Python as the Python platform is a very very late adopter of modern TLS standards. Even today, in 2015, it's still a hurdle to use httpie with a SNI endpoint, and forget about it making it talk to a ECDSA-based endpoint like those exposed by the free tier of Cloudflare (so called "modern TLS"). I wonder how long it will take to HTTP2 to land.

I tried a random rewrite of httpie in Go and it worked perfectly with those endpoints, as expected, and Go is getting full HTTP2 with 1.5 in June. Too bad the rewrite was still feature incomplete, when I tried it.


The situation is not ideal but more recent versions of Python (2.7.9 and 3.4) have a much improved TLS support and things like SNI work out of the box.

For older Python versions there are some additional dependencies to be installed manually (will happen automatically in next version of HTTPie):

https://github.com/jakubroztocil/httpie#sni-server-name-indi...

As for HTTP/2, there is an experimental extension for now:

https://github.com/jakubroztocil/httpie-http2


I had the same feelings but gave it a try .. it works great, and you can construct http(s) request more naturaly, like..

    http POST example.org name=jhon pass=12345
which results in ..

    POST / HTTP/1.1
    Accept: application/json
    Accept-Encoding: gzip, deflate, compress
    Content-Length: 33
    Content-Type: application/json; charset=utf-8
    Host: example.com
    User-Agent: HTTPie/0.8.0

    {
        "name": "jhon", 
        "pass": "12345"
    }
..everything beautifully printed in nice colors

thanks for sharing!


Serves the same purpose, for sure. However, I think the interface is more intuitive/clean for json rest apis.

I usually end up using HTTPie for manual work / ad-hoc checks. And then when I script it I tend to end up using curl, because curl is available everywhere and I never need to worry if it's installed everywhere I'll want to the script to run.


Except much nicer - especially if you work with json APIs


I found httpie last week when I started to think I should write a replacement for curl with a much better UI.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: