Download presentation
Presentation is loading. Please wait.
Published byOswald Brooks Modified over 9 years ago
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 My First Heading My first paragraph.
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: 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. HTTP12
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) HTTP13
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 HTTP14
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.