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 80
Connected to (
Escape character is '^]'.
GET /~gshute/net/nettest.html HTTP/1.1
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
If you are reading this comment then you have successfully
conversed with a web server using HTTP.
<h2>Test Page. </h2>
Connection closed by foreign host.
dhcppc1 2% exit


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