Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > 网页制作 > http: Request methods
【标  题】:http: Request methods
【关键字】:http,Request,methods
【来  源】:http://www.cublog.cn/u/7449/showart.php?id=90771

http: Request methods

Your Ad Here

HTTP defines eight methods indicating the desired action to be performed on the identified resource.

  • GET – Requests a representation of the specified resource. By far the most common method used on the Web today.
  • HEAD – Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
  • POST – Submits user data (e.g. from a HTML form) to the identified resource. The data is included in the body of the request.
  • PUT – Uploads a representation of the specified resource.
  • DELETE – Deletes the specified resource (rarely implemented).
  • TRACE – Echoes back the received request, so that a client can see what intermediate servers are adding or changing in the request.
  • OPTIONS – Returns the HTTP methods that the server supports. This can be used to check the functionality of a web server.
  • CONNECT – For use with a proxy that can change to being an SSL tunnel.

Methods GET and HEAD are defined as safe, i.e. intended only for information retrieval. Unsafe methods (such as POST, PUT and DELETE) should be displayed to the user in a special way (e.g. as buttons rather than links), making the user aware of possible side effect of their actions (e.g. financial transaction).

Methods GET, HEAD, PUT and DELETE are defined to be idempotent, meaning that multiple identical requests should have the same effect as a single request. Also, the methods OPTIONS and TRACE should not have side effects, and so are inherently idempotent.

Despite the specified idempotence of GET requests, in practice, GET requests are often used to pass HTML form values or other data to an HTTP server. These requests can cause changes on the server, through CGI execution, which may result in different effects for successive identical requests. For example, an HTML page may use a link to cause the deletion of a database record; merely GET-ing a particular URL on a server will cause the CGI application on the server to delete a record, thus causing a change of the server's state and possibly making identical following requests to this URL to fail, on account of the database record already being deleted. This behavior is technically discouraged (non-idempotent actions should ideally be initiated by a POST request) but is very common on the modern World Wide Web. Such behavior can cause problems because various schemes for caching web pages, such as search engines, which by design GET pages before a user initiates a request, can cause unintentional changes on a server.

HTTP servers are supposed to implement at least GET and HEAD methods and, whenever possible, also OPTIONS method.

如何使地址栏的HTTP地址保持不变:【上一篇】
XmlHttp学习笔记:【下一篇】
【相关文章】
  • 如何使地址栏的HTTP地址保持不变
  • s-http-server 安装全过程
  • ASP编程入门进阶(四):内置对象Request
  • 用IdHTTP获取UTF-8编码的网页
  • HTTPS协议
  • XMLHTTP异步获取返回值的代码超时测试(AJAX)
  • IIS 6.0配置HTTP压缩
  • 我的收藏:Community Server专题三:HttpModule
  • 我的收藏:Community Server专题四:HttpHandler
  • 采用HttpModules来重写URLs(原理篇)
  • 【随机文章】
  • 微软发布WF教程及大量示例
  • VB.NET注册表编程
  • 由一个日期, 怎样知道是星期几?
  • 一个势力的爸爸
  • How To Solve BuG:INIT: Id "X" respawning too fast
  • 用 eclipse 来开发 compiere的配置
  • 历史上最垃圾的几个网络游戏
  • IE浏览器八大经典故障写真集
  • OnUnLoad事件不起作用的解决方法
  • Linux命令Man解释:mkdir:创建目录
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.