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

LI
lienhejb
0 lượt tải
26
0

Nội dung tài liệu

Trang 2

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

Trang 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

Trang 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

Trang 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)

Trang 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.

Trang 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.

Trang 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.

Trang 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.

Trang 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

Trang 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

Trang 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

Hiển thị 20 trang đầu. Tải tài liệu để xem đầy đủ.

Bình luận (0)

Đăng nhập để tham gia bình luận

Chưa có bình luận nào. Hãy là người đầu tiên!