close

Вход

Забыли?

вход по аккаунту

?

Lecture 1: Web Essentials

код для вставкиСкачать
Client, Server, HTTP, IP Address, Domain Name
Client-Server Model
A text file named
finance.html
Client Bob
Internet
http://yahoo.com/finance.html
Yahoo Server
HTTP: Hypertext Transport Protocol
п‚— HTTP 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.
HTTP Request Message
п‚— Every HTTP request message has the same basic
structure:
п‚— Start Line (request method, URI, HTTP version)
п‚— Header field(s) (one or more)
п‚— Blank line
п‚— Message body (optional)
п‚— GET /tian/public_html/teaching.html HTTP/1.1
host: ww2.cs.fsu.edu
HTTP Request Method
п‚— GET: 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
HTTP Header Fields
п‚— The Host header field is required in every HTTP/1.1
request message.
п‚— Three major header fileds:
п‚— Host: www.yahoo.com
п‚— User-agent: Mozilla/5.0 (Windows)
п‚— Accept: text/html, application/xml (MIME types)
п‚—
Content types that are acceptable for the response
HTTP Response Message
п‚— Every HTTP response message has the same basic
structure:
п‚— Status Line (HTTP version, status code, Reason Phrase)
п‚— Header field(s) (one or more)
п‚— Blank line
п‚— Message body (optional)
п‚— HTTP/1.1 200 OK
HTTP/1.1 404 NOT FOUND
Example of HTTP Request Message
п‚— Try to retrieve the file at
http://ww2.cs.fsu.edu/~tian/public_html/webDevelopme
nt.html
GET /~tian/public_html/webDevelopment.html HTTP/1.1
Host: ww2.cs.fsu.edu
User-Agent: Molliza9.0 (Windows)
Accept: text/html
Example of HTTP Response Message
HTTP/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>
IP address and Domain Name
п‚— Every 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.
Client-Server Communication
What is the IP address of
“yahoo.com”
DNS
Client Bob
yahoo.com’s IP
address is
98.138.252.30
HTTP Request
HTTP Response
Yahoo
Server
Web Client
п‚— Web 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-Wars
п‚— En.wikipedia.org/wiki/Browser_wars
п‚— Each company trying to add features and performance to its
browser in order to increase its market share.
Browser War
п‚— What 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.
Server
п‚— The 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.
Next Class
п‚— History of HTML
п‚— Basic elements of HTML5
п‚— Write your first web page in HTML5
Документ
Категория
Без категории
Просмотров
10
Размер файла
89 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа