htm l URL a standard for specifying any kind of information on the Internet it

Htm l url a standard for specifying any kind of

This preview shows page 27 - 37 out of 78 pages.

htm l URL : a standard for specifying any kind of information on the Internet; it defines 4 things:
Image of page 27

Subscribe to view the full document.

28 HTTP request message HTTP request message: ASCII (human-readable format) GET/POST/HEAD/PUT methods/commands: GET /somedir/page.html HTTP/1.1 Method: GET Host: URL: /somedir/page.html User-agent: Mozilla/4.0 Connection: close Accept-language:en request line header fields
Image of page 28
29 Uploading form input Post method: to provide some input to the server - appending a new data such as posting a message to a newsgroup or adding a file to a bulletin board Web page often includes form input Input is uploaded to server in entity body URL method: Uses GET method – to retrieve a document Input is uploaded in URL field of request line:
Image of page 29

Subscribe to view the full document.

30 Method types HTTP/1.0 GET POST HEAD -when a client wants some information about the document (its header) but not the document itself HTTP/1.1 GET, POST, HEAD PUT uploads file in entity body to path specified in URL field – web publishing DELETE deletes file specified in the URL field
Image of page 30
31 HTTP Response Message consists of a status line , headers , and sometimes a body status line HTTP version : same as above Status code : a three digit number specifying the status of a command; the first digit is used to divide the responses into 5 major groups Status phrase : status code in text form
Image of page 31

Subscribe to view the full document.

32 HTTP response message 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 ... status line (protocol, status code - status phrase) header lines data, e.g., requested HTML file
Image of page 32
33 HTTP response status codes 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported In first line in server->client response message. A few sample codes:
Image of page 33

Subscribe to view the full document.

34 User-server state: cookies Many major Web sites use cookies Four components: 1) cookie header line in HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host, managed by user’s browser 4) back-end database at Web site Example: Alice always access Internet from PC visits specific e-commerce site for first time when initial HTTP requests arrives at site, site creates: unique ID entry in backend database for ID
Image of page 34
35 Cookies: keeping “state” (cont.) client server usual http response msg usual http response msg cookie file one week later: usual http request msg cookie: 1678 cookie- specific action access ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry usual http response Set-cookie: 1678 ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- spectific action access ebay 8734 amazon 1678 backend database
Image of page 35

Subscribe to view the full document.

36 Cookies (continued) What cookies can bring: authorization
Image of page 36
Image of page 37
  • Fall '14

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes