1 / 19

Operating Systems

Operating Systems. Lesson 12. HTTP vs HTML. HTML: hypertext markup language Definitions of tags that are added to Web documents to control their appearance HTTP: hypertext transfer protocol The rules governing the conversation between a Web client and a Web server. HTML.

akando
Download Presentation

Operating Systems

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. Operating Systems Lesson 12

  2. HTTP vs HTML • HTML: hypertext markup language • Definitions of tags that are added to Web documents to control their appearance • HTTP: hypertext transfer protocol • The rules governing the conversation between a Web client and a Web server

  3. HTML <html><body> <h1>My First Heading</h1> <p>My first paragraph.</p> <img src="hackanm.gif" width="45“ height="45" /></body> </html>

  4. HTTP • HTPP is a text-based protocol: uses text to represent its control messages • HTTP is a asymmetric: there are a client and server • HTTP is stateless: a session consist of single request/response pair • HTTP servers usually listen to incoming TCP connection on port 80

  5. URL

  6. HTTP Request

  7. HTTP Response

  8. HTTP request format Cr=‘\r’ lf=‘\n’

  9. HTTP response format

  10. Static vs. Dynamically Generated HTML pages

  11. Passing Parameters to the Web Server • HTML: • <form name="input" action=“form.asp" method="get"> <input type="text" name="user" /> <input type="submit" value="Submit" /></form> • Browser: • HTTP Request: • GET form.asp?user=tom HTTP/1.1 • Common Gateway Interface(CGI) • Standard for passing query parameters to the scripts/applications • Parameters(query string) via environment variable

  12. Some HTTP Request Methods • GET: retrieve information identified by the URL. • HEAD: retrieve meta-information about the URL • POST: send information to a URL and retrieve result. HTTP

  13. Response Status Line HTTP-Version Status-Code Message • Status Code is 3 digit number (for computers) • 1xx Informational • 2xx Success • 3xx Redirection • 4xx Client Error • 5xx Server Error • Message is text (for humans) HTTP

  14. Example Status Lines HTTP/1.0 200 OK HTTP/1.0 301 Moved Permanently HTTP 1/0 304 Not Modified HTTP/1.0 400 Bad Request HTTP/1.0 500 Internal Server Error HTTP

  15. Some Request Headers • User-Agent • Identification of the browser software • Accept • MIME types that browser is ready to accept • If-Modified-Since • Date of cached reqource

  16. Some Response Headers • Content-Type: • Type of the returned content • MIME identifier • text/html, video/mpeg • Content-Length • Size of the content in bytes • Last-Modified • Date of last modification

  17. Persistent Connection • HTTP 1.0 TCP connection is closed after each request/response exchange • HTTP 1.1 allows keeping TCP connection for next request/response • Browser: request header • Connection:Keep-Alive • Default in HTTP 1.1

  18. Cookies • Need a state over HTTP • Cookie Mechanism • Server instructs browser to keep a named value and send it back to the server along with next request • Cookie Expiration Policy • Session cookie: forget cookie after browser is closed • Expiration time: forget after prescribed time

  19. Cookie Headers • Server (Response Header) • Set-Cookie: name_a=value • Client (request Header) • Cookie: name_a=value; name_b=value

More Related