A WWW Server is a piece of software running on a computer that listens
on a TCP port for incoming connections from clients.
It expects a connecting client to speak a protocol called HTTP or
HyperText Transfer Protocol. The connecting client is usually a
browser such as Mosaic, which will request some information
from the server, and the server will then return the requested
information to the client
.
HTTP is a pretty simple protocol, and if you want to see what actually
happens, you can telnet to a WWW server and talk to it
yourself. The simplest HTTP request is GET. An example
of telnetting to a server and issuing a GET request is:
telnet> open macpb1.cs.ucl.ac.uk 80Connected to macpb1.cs.ucl.ac.uk
Escape character is '^ ]'.
GET /index.html HTTP/1.0
HTTP/1.0 200 OK
MIME-Version: 1.0
Server: MacHTTP
Content-type: text/html
<title>Mark's Powerbook on the Web</title>
<h1>Welcome to Mark's WWW server</h1>
This temporary server is running on an Apple Macintosh
Powerbook 180 using MacHTTP 1.3.
There's not much here right now, except for the
<a href=Default.html>HTTP documentation</a>.
The request I made was `` GET /index.html'' and as an additional parameter, I told the server I spoke `` HTTP/1.0''. The server responded with the document index.html, and also with some additional information. The first line of the response says that the server is also speaking `` HTTP/1.0'', that the status code my request returned was `` 200'', which in human terms means `` OK''. The next line gives information about the version of MIME (see section 5.2). Then there's a line that says what type of server this was. And finally there's a line that says the `` Content-Type'' is `` text/html''. This last line is actually giving the MIME content type, which is how the server tells the client what to do with the information that follows. In this case it says that what follows is actually ``text'' (as opposed to an image, video, audio or a whole host of other possibilities), and that this particular text is in `` html'' format. If we'd asked for this information using a WWW client instead of telnet, the client would have read the Content-Type line, and known to feed the data following into it's HTML interpreter.