How the Web Works

We can do what a web browser would do. First establish a connection to a web server using TELNET, but you need to use port 80 rather than the default. Then type

GET <relative url> HTTP/1.0

where <relative url> is the file portion of the URL of the document you want to retrieve. For example, try

GET /courses/cs104/lectures/www/demo.html HTTP/1.0

Finally, we need to send a carriage return character, which is also called control-M. To do this, hold down the control key (often labeled "ctrl") and press "m".

You should see the file streaming by in the telnet window. When the file has been transfered then the telnet session will be automatically terminated (possibly making the telnet window disappear). If possible, scroll back up the window and look at the information the web server sent before the file.