How can I use Telnet to download an element of a Web page?

I recently wanted to download a file from a Web site without using a browser, just in raw text format. I used the Telnet command to perform the operations normally performed as part of the HTTP download process, which are essentially a series of GET commands. To initiate the connection, telnet to port 80 (instead of the default port 23) of the Web site, as the following example shows:

c:>telnet 80

Nothing will be displayed to screen. Type the GET command in uppercase letters:

GET /index.html (press enter twice)

The page will then be displayed in the command window, and the Telnet session will terminate. You might need to append “HTTP/1.0″ at the end of the GET command (as the example below shows) depending on the Web server you’re connecting to. This tells the server which version of HTTP your client understands.

GET /index.html HTTP/1.0

Related Posts Plugin for WordPress, Blogger...

Got anything to say? Go ahead and leave a comment!