Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http://...

15
Lecture 1: Web Essentials Client, Server, HTTP, IP Address, Domain Name

Transcript of Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http://...

Page 1: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Lecture 1: Web EssentialsClient, Server, HTTP, IP Address, Domain

Name

Page 2: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Client-Server Model

Client Bob Yahoo Server

http://yahoo.com/finance.html

A text file named finance.html

Internet

Page 3: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

HTTP: Hypertext Transport ProtocolHTTP is a form of communication protocol which

specifies how web clients and servers should communicate.

The basic structure of HTTP follows a request-response model.

A client always initiates a request message to the server; the server generates a response message.

Page 4: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

HTTP Request MessageEvery HTTP request message has the same basic

structure:Start Line (request method, URI, HTTP version)Header field(s) (one or more)Blank lineMessage body (optional)

GET /tian/public_html/teaching.html HTTP/1.1

host: ww2.cs.fsu.edu

Page 5: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

HTTP Request MethodGET: request server to return the resource

specified by the Request-URI as the body of a response message

POST: pass the body of this request message on as data to be processed by the resource specified by the Request-URL

Page 6: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

HTTP Header FieldsThe Host header field is required in every HTTP/1.1

request message.

Three major header fileds:Host: www.yahoo.comUser-agent: Mozilla/5.0 (Windows)Accept: text/html, application/xml (MIME types)

Content types that are acceptable for the response

Page 7: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

HTTP Response MessageEvery HTTP response message has the same basic

structure:Status Line (HTTP version, status code, Reason Phrase)Header field(s) (one or more)Blank lineMessage body (optional)

HTTP/1.1 200 OK

HTTP/1.1 404 NOT FOUND

Page 8: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Example of HTTP Request MessageTry to retrieve the file at

http://ww2.cs.fsu.edu/~tian/public_html/webDevelopment.html

GET /~tian/public_html/webDevelopment.html HTTP/1.1

Host: ww2.cs.fsu.eduUser-Agent: Molliza9.0 (Windows)Accept: text/html

Page 9: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Example of HTTP Response MessageHTTP/1.1

Date: Fri, 31 Dec 1999 14:20:00 GMT

Content-Type: text/html

Content-Length: 1354

<html>

<body> <p>Welcome to CGS 3066</p>

</body>

</html>

Page 10: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

IP address and Domain NameEvery computer on the Internet has an IP address such as

192.0.34.166

Humans find it easier to refer to computers by names, such as yahoo.com. This is called host/domain name.

DNS (Domain Name Service) provides a mechanism for mapping back and forth between IP addresses and host names.

Page 11: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Client-Server Communication

Client Bob DNS

What is the IP address of “yahoo.com”

yahoo.com’s IP address is98.138.252.30

Yahoo Server

HTTP RequestHTTP Response

Page 12: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Web ClientWeb client is a software that accesses a web server by

sending an HTTP request message and processing the resulting HTTP response.

Web Browser is a typical web client. IE, Firefox, Safari, etc

Browser-WarsEn.wikipedia.org/wiki/Browser_warsEach company trying to add features and performance to its

browser in order to increase its market share.

Page 13: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Browser WarWhat are the advantages?

What are the disadvantages?

Despite this diversity, all of the major modern browsers support a common set of basic user features and provide similar support for HTTP communication.

Page 14: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

ServerThe primary feature of every web server is to

accept HTTP request from web client and return an appropriate resource (if available) in the HTTP response.

1. Wait for connection requests from a client.

2. Receive an HTTP request.

3. Finding the requested file and creates an HTTP response that contains the file in the body of the response message.

Page 15: Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server http:// yahoo.com/finance.html A text file named finance.html.

Next ClassHistory of HTMLBasic elements of HTML5Write your first web page in HTML5