Wednesday, December 15, 2010

Overview of the responsibilities of a Web browser and the Web server.

The basics of HTTP and how browsers and servers use it to process user requests.

A Web application is unlike a standard Windows application. It does not run in a single
process on a single machine. Instead, it is typically hosted on a Web server and accessed via
a Web browser on a client machine. The communication between the Web server and Web
browser is sent using HTTP.

It is imperative you have a basic understanding of how these items work and communicate together before you start writing much code.

The communication process between browser and server can be generalized into the following steps:

1. A user uses his or her Web browser to initiate a request for a Web server resource.
2. HTTP is used to send a GET request to the Web server.
3. The Web server processes the GET request on the server (locating the
requested code and running it).
4. The Web server then sends a response back to the Web browser. The HTTP protocol is
used to send the HTTP response back to the Web browser.
5. The user’s Web browser then processes the response (HTML and JavaScript)
and renders the Web page for display to the user.
6. The user may then enter data and perform an action such as clicking a submit button
that causes his or her data to be sent back to the Web server for processing.
7. HTTP is used to POST the data back to the Web server.
8. The Web server then processes the POST request (again, calling your code in the
process).
9. The Web server then sends a response back to the Web browser. HTTP is used to send
the HTTP response to the Web browser.
10. The Web browser again processes the response and displays the Web page to the user.
This process is repeated over and over during a typical Web application session.

No comments:

Post a Comment