1 / 20

Chapter 22

Chapter 22. World Wide Web: HTTP. Objectives . Upon completion you will be able to:. Know how HTTP accesses data on the WWW. 22.3 HTTP.

melora
Download Presentation

Chapter 22

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 22 World Wide Web:HTTP Objectives Upon completion you will be able to: • Know how HTTP accesses data on the WWW TCP/IP Protocol Suite

  2. 22.3 HTTP 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 TCP/IP Protocol Suite

  3. Figure 22.12HTTP transaction HTTP uses the services of TCP on the well-known port number 80. TCP/IP Protocol Suite

  4. Figure 22.13Request and response messages A request message consists of a request line, a header, and sometimes a body. A response message consists of a status line, a header, and sometimes a body. TCP/IP Protocol Suite

  5. Figure 22.14Request and status lines Request type: a particular method (methods are shown on the next slide) HTTP version: 1.1 Status code: similar to those in SMTP (see slides 7 and 8) Status phrase: the text version of the status code (also shown in slides 7 and 8) TCP/IP Protocol Suite

  6. Table 22.1 Methods TCP/IP Protocol Suite

  7. Table 22.2 Status codes TCP/IP Protocol Suite

  8. Table 22.2 Status codes (continued) TCP/IP Protocol Suite

  9. Figure 22.15Header format The header exchanges additional info between the client and the server. The header can consist of one or more header lines. Each header line looks like this: There are four categories of header lines: general header, request header, response header, and entity header. TCP/IP Protocol Suite

  10. Table 22.3 General headers Gives general information about the message and can be present in both a request and a response. TCP/IP Protocol Suite

  11. Table 22.4 Request headers Only present in a request message; specifies the client’s configuration and preferred document format. TCP/IP Protocol Suite

  12. Table 22.5 Response headers TCP/IP Protocol Suite

  13. Table 22.6 Entity headers Gives info about the body of the document; mostly present in response messages, but also present in some request messages such as POST or PUT methods that contain a body. TCP/IP Protocol Suite

  14. Example 1 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 lineand 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 TCP/IP Protocol Suite

  15. Figure 22.16Example 1 TCP/IP Protocol Suite

  16. Example 2 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). See Next Slide TCP/IP Protocol Suite

  17. Figure 22.17Example 2 TCP/IP Protocol Suite

  18. Example 3 Here is the first request in a notification server session: POST http://gateway.messenger.hotmail.com/gateway/gateway.dll?Action=open&Server= NS&IP=messenger.hotmail.com HTTP/1.1Accept: */*Accept-Language: en-usAccept-Encoding: gzip, deflateUser-Agent: MSMSGS Host: gateway.messenger.hotmail.comProxy-Connection: Keep-AliveConnection: Keep-AlivePragma: no-cacheContent-Type: application/x-msn-messengerContent-Length: 18 VER 5 MSNP8 CVR0 TCP/IP Protocol Suite

  19. Example 3 Here is the response: HTTP/1.0 200 OKServer: Microsoft-IIS/5.0Date: Tue, 18 Mar 2003 07:39:53 GMTX-MSN-Messenger: SessionID=954547325.13160; GW-IP=207.46.110.18Content-Length: 18Content-Type: application/x-msn-messengerAge: 0Via: HTTP/1.1 ntl_site (Traffic-Server/5.2.0-R [c sSf ])X-Cache: MISS from nautilus.localdomainX-Cache-Lookup: MISS from nautilus.localdomain:80Proxy-Connection: keep-alive VER 5 MSNP8 CVR0 TCP/IP Protocol Suite

  20. HTTP version 1.1 specifies a persistent connection by default. In other words, the server leaves the connection open for more requests after sending a response. HTTP v1 opened a separate TCP connection for each part (image) of the web page. Very wasteful. TCP/IP Protocol Suite

More Related