Slide Web thế hệ mới - Chapter 12 http basic examples

LI
lienhejb
0 次下载
28
0

资料内容

第 3 页

2. Browser sends HTTP request to server GET /comp1274/randyc/lab10done/enter_country.htm HTTP/1.1 Accept: */* Accept-Language: en-us,en-ca;q=0.5 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) Host: csweb2.mtroyal.ca Connection: Keep-Alive http://en.wikipedia.org/wiki/HTTP_persistent_connection Sử dụng cùng một TCP connection cho nhiều HTTP request HTTP Request Browser Web Server

第 4 页

3. Server receives and processes the HTTP request HTTP Request Browser Web Server Retrieve Requested file

第 5 页

4. Server sends HTTP response back HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Server Date: Thu, 30 Mar 2006 19:50:54 GMT Content-Type: text/html HTTP Accept-Ranges: bytes Response Last-Modified: Fri, 24 Mar 2006 17:50:50 GMT Content-Length: 209 Browser <HTML><HEAD><TITLE>Enter A Country</TITLE></HEAD> <BODY> <FORM METHOD=POST ACTION=form_filter.asp> Enter Country Search: <INPUT TYPE=TEXT NAME=Search><P> <INPUT TYPE=SUBMIT> </FORM> </BODY></HTML>

第 8 页

7. Browser sends HTTP request to server POST /comp1274/randyc/lab10done/form_filter.asp HTTP/1.1 Accept: */* Referer: http://csweb2.mtroyal.ca/comp1274/randyc/lab10done/enter_country.htm Accept-Language: en-us,en-ca;q=0.5 Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) Host: csweb2.mtroyal.ca Content-Length: 13 Connection: Keep-Alive Cache-Control: no-cache Search=Canada User entered form data goes here in the http request header as a name=value pair

第 9 页

Digression: What if GET rather than POST? <FORM METHOD=GET ACTION=form_filter.asp> Then the user entered form data is added to the requested URL GET /comp1274/randyc/lab10done/form_filter.asp?Search=Canada HTTP/1.1 Versus <FORM METHOD=POST ACTION=form_filter.asp> Then the user entered form data is added to the end of HTTP request header POST /comp1274/randyc/lab10done/form_filter.asp HTTP/1.1 rest of HTTP request header goes here Search=Canada

第 10 页

8. Server receives and processes the HTTP request HTTP Request Browser Web Server Server processes the request

第 11 页

9. Server script generates response sent back to browser HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Thu, 30 Mar 2006 19:51:06 GMT Content-Length: 164 Content-Type: text/html Cache-control: private <HTML><HEAD><TITLE>Reading Recordsets</TITLE></HEAD> <BODY> <H2>Countries</H2> <TABLE BORDER=1> <TR><TD>2</TD><TD>Canada</TD></TR> </TABLE> </BODY></HTML>

第 15 页

2. Browser sends HTTP request to server GET /comp1274/randyc/lab10done/data_browser.asp HTTP/1.1 Accept: */* Accept-Language: en-us,en-ca;q=0.5 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) Host: csweb2.mtroyal.ca Connection: Keep-Alive

第 16 页

3. Server receives and processes the HTTP request HTTP Request Browser Web Server Server processes the request

第 17 页

4. Server script generates response sent back to browser HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Thu, 30 Mar 2006 19:51:06 GMT Content-Length: 1590 Content-Type: text/html Cache-control: private <HTML><HEAD><TITLE>Data Browser</TITLE></HEAD> <BODY> <HR>SELECT * FROM Movies WHERE RunTime < 90<HR> <TABLE BORDER=1> <TR> <TD><B>Title</B></TD> <TD><B>Release Date</B></TD> <TD><B>Run Time</B></TD> </TR> ...

第 20 页

7. Browser sends HTTP request to server GET /comp1274/randyc/lab10done/movie.asp?ID=84 HTTP/1.1 Accept: */* Referer: http://csweb2.mtroyal.ca/comp1274/randyc/lab10done/data_browser.asp Accept-Language: en-us,en-ca;q=0.5 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) Host: csweb2.mtroyal.ca Connection: Keep-Alive

显示前 20 页。下载资料查看完整内容。

评论 (0)

登录 以加入讨论

暂无评论。快来抢沙发吧!