6 ms·
HTTPie: a CLI, cURL-like tool for humans
- partycoder 10y agoRight, let's take the human denomination away from people that use cURL...
- NegativeLatency 10y agoThis tool pops up every few months, not sure why anyone would use it over curl
- peterwwillis 10y agoIf this had been made an interface to libcurl, or added to a separate tool in the curl distribution, most of the novel functionality could have been adopted 3 years ago without the need to support a separate project and HTTP library.
- scrollaway 10y agoWhat do you mean? libcurl is as much a separate project/library as requests is, and this uses requests.
- peterwwillis 10y agoRephrase: If this was implemented with libcurl and bundled with cURL it would no longer need to exist as a separate project because cURL would develop and support it. Does that make more sense?
- scrollaway 10y agoI think I understand what you're saying, but all it would be is a change of ownership/packaging. httpie is only an interface to lower level libraries which already exist (requests and therefore urllib3). Whether it's an interface to requests or to libcurl matters fairly little. It'd be quite a drag if it were to libcurl in fact because syntax highlighting would be a lot harder, for example.
- peterwwillis 10y ago"all it would be" is a gigantic wealth of new functionality that requests/urllib3 does not have (compare libcurl and urllib3 features), along with greater support, developer base, test coverage, user base, and lower tco. httpie gains a wealth of advantages and cURL gets syntax highlighting. It's hard to overstate how advantageous to httpie it would be.
- scrollaway 10y agoYou are extremely confused at which level it is beneficial to merge projects. You don't simplify things by going from one popular lib to another, especially when they both have legitimate use cases. Requests is one of Python's most highly regarded libs and a very popular one at that. Httpie is not its only user. And what you are describing is not a simple process. Gaining tests and features (what features anyway?) is not good enough for it.
- peterwwillis 10y ago> You are extremely confused at which level it is beneficial to merge projects. Not really, since if you read my comments I suggested they could have been merged into cURL three years ago (after starting four years ago). It wouldn't even be a new project, it would simply be an add-on tool. And that's the point.
- dimino 10y agoCan you restate your thesis? Is is that HTTPie should be merged into the cURL project?
- peterwwillis 10y ago> they could have been merged into cURL three years ago (after starting four years ago) > If this was implemented with libcurl and bundled with cURL > httpie gains a wealth of advantages > along with greater support, developer base, test coverage, user base, and lower tco > and cURL gets syntax highlighting
- dimino 10y agoBy that logic, if Firefox were implemented with libcurl and bundled with cURL, it would no longer need to exist as a separate project. I'm not sure I understand your point.
- detaro 10y agoWhat makes you assume that the cURL project wants to support features like syntax highlighting, a second style of command line arguments, ... and would accept such contributions?
- scrollaway 10y agoBecause 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 10y ago> 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"...
- deleted 10y ago[deleted]
- sleepyhead 10y agoWhy would you use curl over httpie?
- alayne 10y agohttpie works at a higher level of abstraction.
- dimino 10y agoA minor logical point, but no one said cURL was not for humans. More than one thing can be "for humans".
- alayne 10y agoThat's not a charitable interpretation of the headline. They are saying that HTTPie is more user friendly.
- theaustinseven 10y agoI 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 10y agoFor me it has been incredibly useful for quickly testing some REST APIs.
- the_common_man 10y agoAlmost 20k stars. That's quite incredible for a project especially since I have never heard of it before now.
- stepanhruda 10y ago12 minutes later, 23k
- orliesaurus 10y agoOne of the first tools I install every time I buy a new machine
- steveax 10y agoThere's also a nice auto-complete utility built on top of HTTPie: https://github.com/eliangcs/http-prompt https://github.com/eliangcs/http-prompt
- homero 10y agoIncredible
- gamedna 10y agoFirst off, I am really surprised how often this gets re-posted to HN. https://hn.algolia.com/?query=httpie&sort=byPopularity&prefix&page=0&dateRange=all&type=story https://hn.algolia.com/?query=httpie&sort=byPopularity&prefi... I discovered HTTPie a few years back and it has completely replaced curl/wget during our API development and testing.
- zymhan 10y agoI 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 10y agothere is an http cli already. it's included in like every OS ever...it's called curl. httpie is just more user friendly
- alayne 10y agoI'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 10y agoIf 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
- toomuchtodo 10y ago+1 for Paw!
- dperfect 10y agoPaw 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.
- pbreit 10y agoHave you tried Postman? Does it not do what you'd like.
- jkbr 10y agoDo you have an example of a request that you're unable to make with HTTPie?
- deleted 10y ago[deleted]
- rdtsc 10y agoI 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...}'
- gamedna 10y agoForgot 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 10y agoReading the docs will probably make people feel all kinds of feelings. Especially the `last` part.
- Sir_Cmpwn 10y agoI don't understand. `echo '[1,2,3,4]' | jq last` seems pretty straightforward to me and so are the docs.
- agumonkey 10y agoI 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
- dang 10y agoPreviously 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=byDate&dateRange=all&type=story&storyText=false&prefix&page=0 https://hn.algolia.com/?query=HTTPie%20points%3E5&sort=byDat...
- paulannesley 10y agoI 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.
- pmontra 10y agoI 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.