Subject: Re: telnet for HTTP download
To: Rose, Brian <Brian.Rose@icn.siemens.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-users
Date: 06/14/2002 12:49:38
On Fri, 14 Jun 2002, Rose, Brian wrote:

> Is there a way to download a file on a HTTP server by doing a GET request
> from within a telnet. I'm not a telnet expert, but I know you can go into
> telnet and connect to web servers and view the pages (in source form). Can
> you also do a GET on a linked binary file and redirect it to a file?

Yes.

Do something like:

(echo "GET /misc/sed.expression HTTP/1.1" ; \
 echo "Host: virtual.name.here" ; echo ; sleep 5) | \
telnet web.server.here 80 > J

But then you'll also get the HTTP headers.

It is usually easier to just use lynx -source, curl, wget, or NetBSD's
ftp.

> P.S. I realize I could just fire up a browser, but I am trying to learn how
> to do as much as possible with as little software as possible. Since telnet
> comes installed as part of the base, knowing how to use it to it's fullest

man ftp

The ftp client installed also can do http.

   Jeremy C. Reed
   http://bsd.reedmedia.net/