Slide Web thế hệ mới - Chapter 11 http

LI
lienhejb
0 次下载
26
0

资料内容

第 2 页

Contents ◼ HTTP and Client-Server model ◼ DNS and URL ◼ HTTP Request and response ◼ Character encoding ◼ Media type

第 3 页

HTTP ◼ HTTP = Hypertext Transfer Protocol  Application-level protocol for distributed, collaborative, hypermedia information systems.  Used for retrieving inter-linked resources led to the establishment of the World Wide Web.  HTTP is a request/response standard of a client and a server.  Client is the end-user using web browser  Server is the web site. ◼ Between client and server there may be several intermediaries: proxies, gateways, and tunnels. ◼ Typically, an HTTP client initiates a request to server over TCP ◼ An HTTP server listens at a particular port (80 by default) waits for the request messages from clients. ◼ Standardization: RFC2616 (HTTP 1.1): http://www.w3.org/Protocols/rfc2616/rfc2616.html

第 4 页

Examples of Web server and client ◼ Web server  IIS: windows  Apache HTTP server (Apache): windows, linux ◼ Web client (Browser)  Internet Explorer: ◼ Free with Windows license, started in 1995 ◼ Support Windows  Mozilla Firefox from Mozilla Corporation ◼ free browser, ◼ Support: Linux, Mac OS X, Microsoft Windows, and many other Unix-like operating system  Safari: developed by Apple Inc. ◼ Support Mac OS, Windows, iPhone OS  Chrome: from Google ◼ Free ◼ Support

第 6 页

Server Client model ◼ Server client model of Web system ◼ HTTP protocol between Client, Server Web Server Store webpage, Process web request 2 Return HTML document 1 3 Browser display the web page Request a web page User (Web Client)

第 9 页

HTTP request and response ◼ Procedure:  HTTP Client (Web Browsers) opens the connection  HTTP Client sends the request message to an HTTP server asking for resource.  The server returns the response message with the request resource.  Once the resource is delivered, Server closes the connection. ◼ HTTP doesn’t store any connection information and ➔ stateless protocol. ◼ In HTTP Connection last for only one transaction. A transaction consists a of several request-response pairs. ◼ The default port is 80.

第 12 页

HTTP Message Structure ◼ An initial line CRLF ◼ Zero or more header lines CRLF ◼ A blank line ie. a CRLF ◼ An optional message body like file, query data or query output.

第 14 页

HTTP Request Message: initial line ◼ Initial line has three parts, separated by spaces:  An HTTP Method Name  The local path of the requested resource.  The version of HTTP being used. ◼ Example of initial line: GET /path/to/file/index.html HTTP/1.0 Method URI HTTP version ◼ Methods: GET, POST ◼ The HTTP version always takes the form "HTTP/x.x", uppercase.

第 15 页

GET and POST methods ◼ GET method used for getting information:  document,  a simple database query ◼ Parameter of GET is seen in the URL  Ex: http://www.google.co.uk/search?hl=en&q=java&meta= ◼ POST method is used when submitting information  credit card number,  information to be saved in the database.  Data is included in the body of the request ◼ Data send using POST is not visible to the client and there is not limit on amount of data being sent.

第 16 页

HTTP Response Message: initial line ◼ The initial response line, called the status line, has three parts separated by spaces:  The version of HTTP being used.  A response status code that gives the result of the request.  An English reason phrase describing the status code. ◼ Examples:  HTTP/1.0 200 OK  HTTP/1.0 404 Not Found

第 19 页

Domain name ◼ The Domain Name System is a hierarchical naming system for computers, services, or any resource participating in the Internet ◼ Example of domain name  www.keio.ac.jp  www.hedspi.hut.edu.vn  .hut.edu.vn

第 20 页

Domain name ◼ Domain Name Service (DNS) map a domain name with an IP address ◼ Domain name  Variable length  Easy to memory by human being  Independent of geographical location of a machine ◼ IP address  Fixed length  Easy to be processed by computer  Related to routing matter 203.162.7.194 www.hedspi.hut.edu.vn www.hut.edu.vn 202.47.142.40

显示前 20 页。下载资料查看完整内容。

评论 (0)

登录 以加入讨论

暂无评论。快来抢沙发吧!