1 / 20

WWW & HTTP Part 2

WWW & HTTP Part 2. Dr. Adil Yousif University of Alneelian – Master of IS- IT. HTTP request message. two types of HTTP messages: request , response HTTP request message: ASCII (human-readable format). request line (GET, POST, HEAD commands). GET /somedir/page.html HTTP/1.1

veronicar
Télécharger la présentation

WWW & HTTP Part 2

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. WWW & HTTPPart 2 Dr. AdilYousif University of Alneelian – Master of IS- IT

  2. HTTP request message • two types of HTTP messages: request, response • HTTP request message: • ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) 2: Application Layer header lines Carriage return, line feed indicates end of message

  3. Request and response messages

  4. HTTP request message: general format 2: Application Layer

  5. Request and status lines

  6. Post method: Web page often includes form input Input is uploaded to server in entity body URL method: Uses GET method Input is uploaded in URL field of request line: Uploading form input www.somesite.com/animalsearch?monkeys&banana

  7. Methods

  8. Status codes

  9. Status codes (continued)

  10. HTTP response message status line (protocol status code status phrase) HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... header lines 2: Application Layer data, e.g., requested HTML file

  11. Header format

  12. Cookies • ال cookie وتعرف ايضاً ب HTTP cookie أو web cookie او ال browser cookie هي عبارة عن small piece of data يتم ارسالها من موقع ويب وتخزن في ال browser اثناء تصفح المستخدم لذلك الموقع . • كل مرة يقوم فيها المستخدم بتحميل ذلك الموقع يقوم المتصفح بارسال ال cookie لل server ليتمكن من معرفة النشاطات السابقة للمستخدم.

  13. Cookies Cont. • على الرغم من ان ال cookies لا يمكنها نقل فيروسات ولا يمكنها تنزيل malware في جهاز المستخدم لكنها قد تساعد في عمليات تتبع المستخدم tracking حيث يمكنها معرفة history التصفح واستعراض المواقع بواسطة المستخدم . • Cookies can also store passwords and forms a user has previously entered, such as a credit card number or an address.

  14. Many major Web sites use cookies Four components: 1) cookie header line in the HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host and managed by user’s browser 4) back-end database at Web site Example: Susan access Internet always from same PC She visits a specific e-commerce site for first time When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID User-server state: cookies

  15. client server usual http request msg usual http response + Set-cookie: 1678 Cookie file Cookie file Cookie file amazon: 1678 ebay: 8734 ebay: 8734 amazon: 1678 ebay: 8734 cookie- specific action usual http request msg cookie: 1678 usual http request msg cookie: 1678 usual http response msg usual http response msg cookie- spectific action Cookies: keeping “state” (cont.) server creates ID 1678 for user entry in backend database access access one week later:

  16. What cookies can bring: authorization shopping carts recommendations user session state (Web e-mail) Cookies (continued) • Cookies and privacy: • cookies permit sites to learn a lot about you • you may supply name and e-mail to sites • search engines use redirection & cookies to learn yet more • advertising companies obtain info across sites

  17. user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client Web caches (proxy server) Goal: satisfy client request without involving origin server origin server Proxy server HTTP request HTTP request client HTTP response HTTP response HTTP request HTTP response origin server client

  18. Cache acts as both client and server Typically cache is installed by ISP (university, company, residential ISP) Why Web caching? Reduce response time for client request. Reduce traffic on an institution’s access link. Internet dense with caches enables “poor” content providers to effectively deliver content (but so does P2P file sharing) More about Web caching 2: Application Layer

  19. Goal: don’t send object if cache has up-to-date cached version cache: specify date of cached copy in HTTP request If-modified-since: <date> server: response contains no object if cached copy is up-to-date: HTTP/1.0 304 Not Modified HTTP response HTTP/1.0 304 Not Modified Conditional GET server cache HTTP request msg If-modified-since: <date> object not modified 2: Application Layer HTTP request msg If-modified-since: <date> object modified HTTP response HTTP/1.0 200 OK <data>

  20. Questions These slides are adapted from Computer Networking: A Top Down Approach Jim Kurose, Keith RossAddison-WesleyMarch 2012

More Related