HTTP over Telnet


The following is a script of an HTTP communication using telnet. It shows both an HTTP request and an HTTP response.

The telnet command is run on a UNIX machine. The command to start the telnet session is shown with a light gray background. The response of the telnet server is shown in pink.

The HTTP request is shown with a light green background. It ends with two successive newline characters. The server does not respond until after it has seen the second newline character. The HTTP response is shown with a light blue background.

You can also use the SocketViewer program to communicate with a web server. To get this program download this zipfile. After unzipping it, enter the unzipped directory and click on the SocketViewer.jar file. The "Help" tab in the program's user interface explains how to operate the program.

Script started on Thu 26 Jan 2006 12:41:26 AM CST
dhcppc1 1% telnet www.d.umn.edu 80
Trying 131.212.109.30...
Connected to www.d.umn.edu (131.212.109.30).
Escape character is '^]'.
GET /~gshute/net/nettest.html HTTP/1.1
Host: www.d.umn.edu
Connection: close
 
HTTP/1.1 200 OK
Date: Thu, 26 Jan 2006 12:48:22 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 180
Connection: close
Content-Type: text/html; charset=ISO-8859-1
 
<html>
 
<!--
If you are reading this comment then you have successfully
conversed with a web server using HTTP.
-->
 
<body>
 
<h2>Test Page. </h2>
 
</body>
 
</html>
 
Connection closed by foreign host.
dhcppc1 2% exit

exit

Script done on Thu 26 Jan 2006 12:42:53 AM CST