Download presentation
Presentation is loading. Please wait.
Published byGervase Nicholson Modified over 8 years ago
1
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering mjchoi@postech.ac.kr
2
2 The WWW is a distributed client-server service, in which a client using a browser can access a service using a server. The service provided is distributed over many locations called sites. The topics discussed in this section include: Client (Browser) Server Uniform Resource Locator (URL) Cookies 22.1 Architecture
3
3 Architecture of WWW
4
4 Browser
5
5 URL
6
6 Cookies oHyper Text Transfer Protocol (HTTP) Manages the hypertext links used to navigate web Ensures Web browsers correctly process and display the various types of information contained in Web pages Original design stateless l No storage of persistent data oReasons for maintaining state information Page customization based on user preference Temp storage of data in multipart forms Bookmarking Shopping carts User ID and password storage Counters for site statistics oThree basic methods for maintaining state information: Hidden form fields Query strings Cookies
7
7 Cookies oSaving State Information w/ Cookies Cookies l Small pieces of information about a user stored by web server in text files on user’s computer l Allows information to be stored beyond the current Web page session l W3C DOM defines cookie specification Two types l Temporary available only for current browser session l Persistent available beyond current browser session Limitations l Maximum of 20 stored by each server or domain l Maximum of 300 total cookies per browser l Maximum size of 4 KB
8
8 The documents in the WWW can be grouped into three broad categories: static, dynamic, and active. The category is based on the time the contents of the document are determined. The topics discussed in this section include: Static Documents Dynamic Documents Active Documents 22.2 Web Documents
9
9 Static Document
10
10 Boldface Tags
11
11 Beginning & Ending Tags
12
12 Dynamic Documents using CGI
13
13 Dynamic Documents using Server Side Script
14
14 Dynamic documents are sometimes referred to as server-site dynamic documents. Note:
15
15 Active Document using Java Applet
16
16 Active Document using Client-site Script
17
17 Active documents are sometimes referred to as client-site dynamic documents. Note:
18
18 The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. HTTP functions like a combination of FTP and SMTP. The topics discussed in this section include: HTTP Transaction Persistent versus Nonpersistent Connection Proxy Server 22.3 HTTP
19
19 HTTP uses the services of TCP on well- known port 80. Note:
20
20 HTTP Transaction
21
21 Request & Response Messages
22
22 Request & Status Lines
23
23 Methods
24
24 Status Codes
25
25 Status Codes (Cont’d)
26
26 Header Format
27
27 General Headers
28
28 Request Headers
29
29 Response Headers
30
30 Entity Headers
31
31 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in the GIF or JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Figure 22.16). See Next Slide Example 1
32
32 Example 1: Solution
33
33 In this example, the client wants to send data to the server. We use the POST method. The request line shows the method (POST), URL, and HTTP version (1.1). There are four lines of headers. The request body contains the input information. The response message contains the status line and four lines of headers. The created document, which is a CGI document, is included as the body (see Figure 22.17). Example 2 See Next Slide
34
34 Example 2: Solution
35
35 HTTP version 1.1 specifies a persistent connection by default. Note:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.