312 CHAPTER 7 Working with forms
After this lesson, you will be able to:
■■Understand basic HTTP protocol actions.
■■Understand how data is sent to the server.
Estimated lesson time: 20 minutes
Understanding web communications
It’s important to understand the roles of the server, browser, and HTTP to develop web appli-
cations. When web communication occurs, the sequence can be generalized into the follow-
ing steps:
- The user browses to a website, which causes the browser to initiate a request for a web
server resource. - HTTP protocol sends a GET request to the web server.
- The web server processes the request.
- The web server sends a response to the web browser, also by using HTTP protocol.
- The browser processes the response, causing a webpage to display.
- The user enters data into a form on the webpage and clicks a Submit button that
causes the data to be sent back to the web server. - HTTP protocol posts the data back to the server.
- The web server processes the data.
- The web server sends the response back to the browser through the HTTP protocol.
- The web browser processes the response, displaying the webpage.
The web server
Web servers originally were responsible for only receiving and handling requests from the
browsers through HTTP. The web server handled the request and sent a response back to the
web browser, and then the web server closed the connection and released all resources that
were involved in the request. Releasing all resources was paramount because the web server
needed to handle thousands of requests per minute. The original webpages were simple,
static HTML pages. The web environment was considered to be stateless because no data was
held at the web server between web browser requests, and the connection was closed after
the response, as shown in Figure 7-1.
Key
Te rms