Live data from Hacker News

Curl, 17 years old today

daniel.haxx.se

21–30 of 100 posts

Re: Curl, 17 years old today

#22
post #2

I'm surprised it's so new. And wget is only a year older... what did people use before then?

Sometimes just plain telnet. It wasn't pretty, but it worked:

    $ telnet 80
    GET /
It should be noted that the above isn't a strict HTTP request header, it's missing quite a lot of detail, but it works as an example.

Re: Curl, 17 years old today

#23

I love curl so much. I just learned that you can 'copy to curl command' from the chrome inspector's network panel by right clicking on any request!! I want to make a library that reads the curl command (and maybe request syntax?) and outputs a function that will do that command.

https://shibukawa.github.io/curl_as_dsl/

Re: Curl, 17 years old today

#24
post #2

I'm surprised it's so new. And wget is only a year older... what did people use before then?

`lynx -dump` was a very useful tool.

I had to use that the other year whilst attempting to migrate an old old old Slackware box running on two Pentium 3s with an array of SCSI disks (so quite fancy for its time!). The machine had kernel sources that were different to the kernel running so no chance of compiling various bits of software, and I couldn't grab any GCC (EGCS?) binaries from anywhere.

I can't remember what I eventually did but I do remember discovering lynx -dump, so thanks for the reminder!

Re: Curl, 17 years old today

#25
post #16

I love curl so much. I just learned that you can 'copy to curl command' from the chrome inspector's network panel by right clicking on any request!! I want to make a library that reads the curl command (and maybe request syntax?) and outputs a function that will do that command.

curl has a --libcurl option which you can add to a curl command line, and then it'll generate a libcurl-using C code template for that same operation...

That's incredibly useful, never knew that. Thanks!

Re: Curl, 17 years old today

#26
post #19
post #17

And still better than wget, which only does http 1.0 and this has problems due to lacking a 'host' header. Curl just works.

> And still better than wget, which only does http 1.0 and this has problems due to lacking a 'host' header. Well I had to check, but this is not true at all: $ nc -l -p 9999 GET / HTTP/1.1 User-Agent: Wget/1.15 (linux-gnu) Accept: */* Host: localhost:9999 Connection: Keep-Alive Also wget can recursively mirror webpages and there are nice options to carefully select contents you want to download. It's quite dated tho…

That mirroring option in wget has been very useful over the years, even more so if you remember to add --no-parent, else you'll end up with the ENTIRE site.

Re: Curl, 17 years old today

#27
post #2

I'm surprised it's so new. And wget is only a year older... what did people use before then?

In the HTTP/1.0 days I used telnet quite a bit. Or libwww-perl, when Perl was the language of choice for web applications. LWP has copyright notice:

Copyright 1995-2009, Gisle Aas

Copyright 1995, Martijn Koster

Round about then I wrote something similar to WWW::Mechanize in order to automate access to the Orange Web-SMS gateway, which had an inconveniently deep login procedure.

Re: Curl, 17 years old today

#29
post #22
post #2

I'm surprised it's so new. And wget is only a year older... what did people use before then?

Sometimes just plain telnet . It wasn't pretty, but it worked: $ telnet 80 GET / It should be noted that the above isn't a strict HTTP request header, it's missing quite a lot of detail, but it works as an example.

Pre curl/wget that was probably sufficient.

HTTP/1.1 wasn't around until 1996 so back then Host: headers weren't even "optional". They simply didn't exist yet.

Post reply on HN