✔ 最佳答案
The standard Web transfer protocol is HTTP (HyperText Transfer Protocol). HTTP is constantly evolving. Several versions are in use and others are under development. The HTTP protocol consists of two fairly distinct items: the set of requests from browsers to servers and the set of responses going back the other way.
Although HTTP was designed for use in the Web, it has been intentionally made more general than necessary with an eye to future object-oriented applications. For this reason, the first word on the full request line is simply the name of the method (command) to be executed on the Web page. The built-in methods are listed:
The GET method requests the server to send the page. If the GET is followed by an If-Modified-Since header, the server only sends the data if it has been modified since the data supplied. Using this mechanism, a browser that is asked to display a cached page can conditionally ask for it from the server, giving the modification time associated with the page. If the cache page is still valid, the server just sends back a status line announcing that fact, thus eliminating overhead of transferring the page again .
The HEAD method just asks for the message header, without the actual page. This method can be used to get a page’s time of last modification, to collect information for indexing purposes, or just to test a URL for validity.
The PUT method is the reverse of GET: instead of reading the page, it writes the page. This method makes it possible to build a collection of Web pages on a remote server. The lines following the PUT might include Content-Type and authentication headers, to prove that the caller indeed has permission to perform the requested operation.
The POST bears a URL, but instead of replacing the existing data, the new data is “append” to it.
DELETE removes the page with authentication and permission play a major role here. There is no guarantee that DELETE succeeds, since even if the remote HTTP server is willing to delete the page, the underlying file may have a mode that forbids the HTTP server from modifying or removing it.
The LINK and UNLINK methods allow connections to be established between existing pages or other sources.
URLs
Each Web page is assigned a URL (Uniform Resource Locator) that effectively serves as the page’s worldwide name. URLs have three parts (use
http://www.cityu.edu.hk/welcome.html as example): the protocol (http), the DNS name of the server on which the page is located (
www.cityu.edu.hk), and the file name (welcome.html).