Bài giảng Web thế hệ mới - Chương 11 http basic
Hyper Text Transfer Protocol (HTTP) www.goupee.com Objective: Understand HTTP (the protocol that makes the Internet possible) Accessing Resources over the Web <protocol>://<server>/<path> Defines the address (Uniform Resource Locator) Communication Protocol between the client and the server Hypertext Transport Protocol (HTTP) characteristics Request-response mechanism: Transaction is initiated by a client sending a request to server Server generates a response Resource Identification Each HTTP request includes a URI (Uniform Resource Identifier) Statelessness The server does not maintain any information about the transaction Meta data support Metadata about information can be exchanged in the messages HTTP Request Format Specifies request method Request Line Header Lines GET /index.html HTTP/1.0 Specifies resource via URI & meta data Host: www.content-networking.com Date: BBBBBBBBBBBB User-Agent: Mozilla/5.0 (en) (WINNT; U) Accept-Language: en-us Carriage Return/Line Feed Message Body Content-length: (Message Payload) Request Methods GET whatever information is identified by the Reuest-URI Can Get static content and data produced by a program POST Submit information to Web Server Eg: posting to blog, submission of user form… Information is included in message body The actual function depends on request URI Example POST/phonebook.cgi.HTTP/1.0 Date: User-Agent: Accept Language: en-us Content Length: 14 98490 55266 Looks up phone book for the number Could have been also achieved by Get But in that case number would have been in the Resource URL Which would have been stored in the log Request Methods…contd (ii) HEAD Servers response does not include message body Useful for getting resource metadata without transferring the resource Also useful for debugging , checking for validity, accessibility and modification PUT Requests a server store the enclosed data under the supplied Request URL. Creates t
… Tải file gốc để đọc toàn bộ tài liệu.
Tài liệu giảng dạy về giao thức HTTP (Hyper Text Transfer Protocol), bao gồm cấu trúc request/response, các phương thức HTTP (GET, POST, HEAD, PUT, DELETE, TRACE, OPTIONS), mã trạng thái, cải tiến trong HTTP/1.1 và quản lý trạng thái qua cookies.
Xem trước tài liệu
Đang tạo bản xem trước...
