5 ms·
I've been using this for a couple months now. With httpie[1], it's become as essential to my work day as Grep. [1] https://github.com/jakubroztocil/httpie http
by xahrepap 11y ago
I've been using this for a couple months now. With httpie[1], it's become as essential to my work day as Grep.
[1] https://github.com/jakubroztocil/httpie https://github.com/jakubroztocil/httpie
- discardorama 11y agoWow, thanks for that link. I hadn't heard of httpie, but it looks pretty slick.
- yunong 11y agoIsn't that the same as curl(1)?
- mugsie 11y agoExcept much nicer - especially if you work with json APIs
- jkbr 11y agoNope. 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 https://github.com/jakubroztocil/httpie#readme (Disclaimer: I created HTTPie)
- giovannibajo1 11y agoI 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.
- jkbr 11y agoThe 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-indication 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 https://github.com/jakubroztocil/httpie-http2
- xahrepap 11y agoServes 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.
- _lce0 11y agoI 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!
- cgag 11y agoI found httpie last week when I started to think I should write a replacement for curl with a much better UI.
- xcombelle 11y agowhat is your work is about ?
- xahrepap 11y agoI do DevOps for a medium sized SaaS company (~500 employees). So often working with scripts, and JQ is a lifesaver any time a bash script needs to grab data from a REST api. Before it was grep/sed/etc. and the scripts would turn ugly quick. Now you get an at-a-glance understanding what the script is trying to grab from the endpoint.