Live data from Hacker News

“I Could Rewrite Curl”

daniel.haxx.se

191–193 of 193 posts

Re: “I Could Rewrite Curl”

#191
post #134

I could write a simplified curl in a week-end, I could even write an HTTP server in the same week-end. The problem, they will only work together, no https of course, that "s" is really annoying. And even that is not as straightforward as one might think. I did it it C, Unix, TCP sockets, nothing unusual, but when you start putting significant load, you start getting errors left and right and you have to handle them p…

With C and something like libev or won’t have issues with load before you have issues with weird http stuff that works for other clients or servers. I just had to modify my squid config to allow airflow Python to to a GET with a four length body: null (and no url-form-encoded content type).

Re: “I Could Rewrite Curl”

#192
post #30

Let's be honest here. Curl to 98% of people is http/1 requests with some post params and maybe json body, with some custom headers. Most language standard libs (which might be using libcurl) can facilitate writing that relatively quickly. And probably with a more 'modern' CLI. Curl though, is a very wide breadth project. It currently supports the following protocols: DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP,…

I'm one of the 98%, and I don't like using cURL for this reason -- the CLI feels clunky and its gigantic number of options are distracting for my simple use case. Can anyone recommend a good alternative for the base case?

I loved using `xh` lately.

https://github.com/ducaale/xh

Re: “I Could Rewrite Curl”

#193

Earlier quoted context omitted.

That was honestly my first thought. Of course it's easy to rewrite curl nowadays. It can't be anything more complicated than slapping a command line interface on top of libcurl...

At first I laughed... then I thought about the sheer number of command line options that you can find in the man pages. After thinking about that, even writing the command line interface would be a non-trivial undertaking.

Documentation takes work too.
Post reply on HN