HTTP pseudo code protocol

In retrieving a Web page, the client and server conduct a scripted "conversation:"
establish a connection

C: HELLO
S: OK
C: I want the page xxx.htm

If a file called xxx.htm exists on this server
   Send xxx.htm
else
   Send an error message in HTML format
End if

S: OK
Display the HTML page the server returned

end connection
If there is a page called xxx.htm on the server, it is returned and displayed. If not, the server returns an error message that is formatted as an HTML page. The client displays whichever it receives.

This dialog takes place between the HTTP client and the HTTP server programs without regard to the details of the network. The client and server computers might be connected to the Internet by dial-up connection, a wireless connection, a high speed link to a LAN, etc. Similarly, the client and server programs could be running on two computers that were thousands of miles apart or in the same room. If this were a developer debugging a Web site, the client and server programs would probably both be running on the same computer!

This is similar to the making a telephone call -- you do not think about the central offices, switches, telephone poles and lines, etc. while talking on the phone (unless you are a major geek).

The HTTP protocol defines the formats of the messages making up the conversation and the order in which they occur. HTTP is an application layer protocol. The details of the communication between the client and server are handled by lower level protocols such as TCP and IP.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.