坏小仔

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
1.4.1 Methods

HTTP supports several different request commands, called HTTP methods. Every HTTP request message has a method. The method tells the server what action to perform (fetch a web page, run a gateway program, delete a file, etc.).

HTTP method & Description

GET

Send named resource from the server to the client.

PUT

Store data from client into a named server resource.

DELETE

Delete the named resource from a server.

POST

Send client data into a server gateway application.

HEAD

Send just the HTTP headers from the response for the named resource.

1.4.2 Status Codes

Every HTTP response message comes back with a status code. The status code is a three-digit numeric code that tells the client if the request succeeded, or if other actions are required.

HTTP status code & Description

200

OK. Document returned correctly.

302

Redirect. Go someplace else to get the resource.

404

Not Found. Can't find this resource.

1.4.3 Web Pages Can Consist of Multiple Objects

An application often issues multiple HTTP transactions to accomplish a task. For example, a web browser issues a cascade of HTTP transactions to fetch and display a graphics-rich web page. The browser performs one transaction to fetch the HTML "skeleton" that describes the page layout, then issues additional HTTP transactions for each embedded image, graphics pane, Java applet, etc. These embedded resources might even reside on different servers. Thus, a "web page" often is a collection of resources, not a single resource.

posted on 2012-08-25 14:37  坏小仔  阅读(132)  评论(0编辑  收藏  举报