HTTP: A Simple Example

You probably already know that HTTP is a "transaction"-style protocol. The browser (the client) sends a request to the server. The server obeys the request if it can and sends a response back to the client. The server then completely forgets about the transaction. The browser may or may not forget about it.

HELLO.HTM, a simple HTML form

Figure 7.1. HELLO.HTM, a simple HTML form

HELLOCGI.HTM, an HTML page created by a CGI application

Figure 7.2. HELLOCGI.HTM, an HTML page created by a CGI application

To illustrate the interaction between web browser and server, let's examine a fairly simple example that illustrates this exchange. Figure 7.1 shows Netscape Navigator displaying a very simple form, HELLO.HTM, that prompts the user for her name. When the user clicks the Submit button, a CGI application is invoked on a WebSite server that sends back the page displayed in Figure 7.2. (Although Navigator and WebSite are used for this example, the exchange between any browser and any server would be more or less identical. Also, although this example uses a CGI application, the HTTP request/response cycle is almost exactly the same as that for ASP applications. For more about CGI-to-ASP conversion, see Appendix B.) Let's see how this interchange between browser and server are handled by the protocol:

  1. When the user finishes entering the URL for HELLO.HTM ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.