Live data from Hacker News

HTTPie: A cURL-like tool for humans

github.com

51–60 of 88 posts

Re: HTTPie: A cURL-like tool for humans

#51
post #24

Earlier quoted context omitted.

There is more to it than that. It provides an expressive syntax to construct all sorts of requests. You can submit forms, upload files and set headers without having to use flags. You also get syntax highlighting, ability to pipe in request data, etc. If you are sending complex JSON, it's probably stored in a file or it's the output of another program: http PUT httpbin.org/put @/data/test.json http -b localhost:8888/…

I don't really think curl is much harder, e.g. curl -X PUT -d @data/test.json httpbin.org/put It also has the advantage that it supports all the options you might ever need, for example http authentication and proxies are often useful.

HTTPie also supports proxies and HTTP auth (see --proxy and -a/--auth).

Re: HTTPie: A cURL-like tool for humans

#53

"for humans" seems to have no better meaning than "for the OS X sensibility". In other words: this is a style change rather than a productivity gain. And the superiority of the style is not obvious - unless you just HATE the style of existing tools and need to be set apart. Most humans don't operate the command line or write scripts to begin with. Those who do, usually can handle wget " http://foo/bar . It took me al…

Gosh, what a horrible comment! The simple fact is that curl and wget's interfaces are bad, and everyone who learns to use them spends that 10 minutes. And then, if you're like me, respends that 10 minutes when I need to do something fancy again. If a new tool were to save 5 minutes (which this one does), that's 5 minutes saved on every use, which is probably a total of a few hours for me personally, and spread over t…

curl and wget might not follow Unix conventions all that well, but from the look of it neither does HTTPie.

Thus the GP's point stands that this program offers little more than a stylistic change. And a bit of pretty printing, which you could (ideally) pipe into some syntax highlighting script or an editor to get the same effect.

Don't read the docs with this thing, for example, and you'd wonder why it defaults to JSON encoding and not the default HTTP POST format. And so the 'simple' version is now dependent on a trend and not the HTTP standard. In fact, even with a modern API I don't recall ever having to serialise my data before posting it. So why this?

That's a few minutes wasted on RTFM already. What else will there be?

Re: HTTPie: A cURL-like tool for humans

#54

Earlier quoted context omitted.

Gosh, what a horrible comment! The simple fact is that curl and wget's interfaces are bad, and everyone who learns to use them spends that 10 minutes. And then, if you're like me, respends that 10 minutes when I need to do something fancy again. If a new tool were to save 5 minutes (which this one does), that's 5 minutes saved on every use, which is probably a total of a few hours for me personally, and spread over t…

Your comment is an ad hominem attack where you falsely accuse someone of making an ad hominem attack.

[deleted]

Re: HTTPie: A cURL-like tool for humans

#56
Everything on HN is just "hey, learn to use this complicated complex thing - in just 30 minutes! You'll be so productive with all your creative startups!"

"Learn VIM essentials in this blog post!" "Never bother reading 'man curl'!" "Learn the basics of C in three easy steps!"

Sometimes HN feels like a lifestyle magazine for people who dream of being PG.

EDIT: Don't get me wrong, I too dream of having the same succes as PG. Why else would I be writing here?

Re: HTTPie: A cURL-like tool for humans

#57
post #45
post #37

Earlier quoted context omitted.

> Most humans don't operate the command line or write scripts to begin with. I'm not a huge fan of cURL, but most people who use cURL don't use the command line either. They use the cURL library and access that functionality through a high level language (PHP, C, C++, whatever).

That's true, but it's no better there, either. Here's some sample curl client code in PHP. $c = curl_init("https://someurl/some/api"); $msg = /* some data here */ $opts = array( CURLOPT_POST=>TRUE, CURLOPT_USERPWD=>" ", CURLOPT_HTTPHEADER=>array("Content-type: application/json"), CURLOPT_POSTFIELDS=>$msg, CURLOPT_SSL_VERIFYPEER=>FALSE, CURLOPT_RETURNTRANSFER=>TRUE ); curl_setopt_array($c, $opts); $d = curl_exec($c);…

On the other hand I guess you could probably write a nice library that uses curl under the hood, here it's just a case of ugly design.

Re: HTTPie: A cURL-like tool for humans

#58

Earlier quoted context omitted.

Gosh, what a horrible comment! The simple fact is that curl and wget's interfaces are bad, and everyone who learns to use them spends that 10 minutes. And then, if you're like me, respends that 10 minutes when I need to do something fancy again. If a new tool were to save 5 minutes (which this one does), that's 5 minutes saved on every use, which is probably a total of a few hours for me personally, and spread over t…

Your comment is an ad hominem attack where you falsely accuse someone of making an ad hominem attack.

You know, I was about to defend myself, but you may be right. My tone of outrage at the slurgfest being wrong was itself rather wrong. If he didn't see the long term incremental improvements this tool offers, that's nothing to be outraged over. People make mistakes.

That said, I think it's a stretch to call this mistake of mine an ad hominem attack. It doesn't fit my normal understanding of such an attack - there was no name calling, etc. And certainly I didn't accuse him of an ad hominem.

Re: HTTPie: A cURL-like tool for humans

#59
post #11

The UI for curl is awful (--request to change the method??) and wget's is only slightly better, but they do have the advantage of ubiquity, and it's often useful to email/Skype complete curl or wget command lines about the place to explain how to use an API, or demonstrate problems. (e.g. Stripe and others document their API in terms of curl commands: https://stripe.com/docs/api. ) I do wish the curl UI was better, b…

It is possible to have another tool become ubiquitous (and in this case, it really would be for the best to have another tool become ubiquitous). In order to do that, though, you have to have a better tool, so this is a great start to making that happen.

Curl after all mostly replaced the earlier wget.

Re: HTTPie: A cURL-like tool for humans

#60

Earlier quoted context omitted.

Your comment is an ad hominem attack where you falsely accuse someone of making an ad hominem attack.

You know, I was about to defend myself, but you may be right. My tone of outrage at the slurgfest being wrong was itself rather wrong. If he didn't see the long term incremental improvements this tool offers, that's nothing to be outraged over. People make mistakes. That said, I think it's a stretch to call this mistake of mine an ad hominem attack . It doesn't fit my normal understanding of such an attack - there wa…

Thanks for pointing that out. I made slurgfest's comment a proxy for slurgfest when I interpreted your comment, and that is indeed a stretch. I agree that neither of you were all that harsh.
Post reply on HN