Datasheet
Although HTTP is the protocol of choice for the Web, most browsers support additional protocols such
as the File Transfer Protocol (FTP).
Much like other protocols, an HTTP conversation consists of a handful of commands from the client and
a stream of data from the server. Although discussing the whole HTTP protocol is beyond this book’s
scope, it is important to grasp the basics of how the protocol operates. By using a telnet client, you can
“talk” to a Web server and try the protocol manually as shown in the following code (text typed by the
user appears with a gray background):
telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is ‘^]’.
GET /index.html HTTP/1.1
Accept: text/plain,text/html
Host: localhost
User-Agent: Telnet
HTTP/1.1 200 OK
Date: Sun, 17 Oct 2004 23:47:49 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
Last-Modified: Sat, 26 Oct 2002 09:12:14 GMT
ETag: “19b498-100e-3dba5c6e”
Accept-Ranges: bytes
Content-Length: 4110
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2//EN”>
<HTML>
<HEAD>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=iso-8859-1”>
<META NAME=”GENERATOR” CONTENT=”Mozilla/4.05 [en] (X11; I; Linux 2.3.99-pre3
i686) [Netscape]”>
<META NAME=”Author” CONTENT=”johnie@debian.org (Johnie Ingram)”>
<META NAME=”Description” CONTENT=”The initial installation of Debian/GNU
Apache.”>
<TITLE>Welcome to Your New Home Page!</TITLE>
</HEAD>
<BODY TEXT=”#000000” BGCOLOR=”#FFFFFF” LINK=”#0000EF” VLINK=”#55188A”
ALINK=”#FF0000”>
<BR>
<H1>Welcome to Your New Home in Cyberspace!</H1>
<HR NOSHADE>
<BR>
<IMG ALIGN=”right” ALT=”” HEIGHT=”247” WIDTH=”278” SRC=”icons/jhe061.gif”>
5
The Basics of HTML
04_588206 ch01.qxd 6/30/05 12:36 AM Page 5