`
hideto
  • 浏览: 2682955 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

HTTP1.1 Notes 6, Method Definitions

Web 
阅读更多
Safe and Idempotent Methods

In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval
These methods ought to be considered "safe"
This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested

Methods can also have the property of "idempotence" in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request
The methods GET, HEAD, PUT and DELETE share this property
Also, the methods OPTIONS and TRACE SHOULD NOT have side effects, and so are inherently idempotent
A sequence that never has side effects is idempotent

OPTIONS
The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI
This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval
Responses to this method are not cacheable

GET
The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI
The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field
The semantics of the GET method change to a "partial GET" if the request message includes a Range header field

HEAD
The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response

POST
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line
If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header

PUT
The PUT method requests that the enclosed entity be stored under the supplied Request-URI
If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server
If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI
The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI
A single resource MAY be identified by many different URIs

DELETE
The DELETE method requests that the origin server delete the resource identified by the Request-URI

TRACE
The TRACE method is used to invoke a remote, application-layer loop- back of the request message
The final recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK) response
A TRACE request MUST NOT include an entity
TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing or diagnostic information

CONNECT
This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel

一般而言Web Server只支持GET和POST,有的可以通过修改默认配置来支持PUT和DELETE,而有的没有实现TRACE
分享到:
评论

相关推荐

    Definitions 1.1.10.0.msi

    Definitions 1.1.10.0.msi

    下载 DVTK Definitions 1.1.10.0.msi

    标题中的“下载 DVTK Definitions 1.1.10.0.msi”表明这是一个软件安装程序,具体来说是DVTK(可能代表Data Validation Toolkit或类似的缩写)的定义文件版本1.1.10.0的MSI(Microsoft Installer)包。这个MSI文件是...

    UVM_1.1_Class_Reference_Final

    6. Reporting Classes 6.1 uvm_report_object 6.2 uvm_report_handler 6.3 uvm_report_server 6.4 uvm_report_catcher 7. Factory Classes 7.1 uvm_*_registry 7.2 uvm_factory 8. Phasing Classes 8.1 ...

    Advanced REST Client的definitions插件

    **高级REST客户端(Advanced REST Client)的definitions插件详解** 高级REST客户端(Advanced REST Client,简称ARC)是一款功能强大的Chrome浏览器扩展,专为开发者设计,用于测试和调试RESTful Web服务。它允许用户...

    definitions.json_

    "method": "GET", "url": "http://example.com/api/resource", "headers": [ {"key": "Content-Type", "value": "application/json"} ], "parameters": [], "body": { "mode": "raw", "raw": "{}" }, ...

    definitions.json

    Chrome扩展AdvanceRestClient加载的json文件definitions.json

    USB UVC协议文档,包括1.0、1.1、1.5版本

    标题中的“USB UVC协议文档,包括1.0、1.1、1.5版本”意味着我们将探讨这三个主要的UVC规范迭代。每个版本都可能引入新的功能、改进或修正前一版本的问题。让我们逐一深入了解这些版本的要点: 1. **UVC 1.0**:这...

    NVM_Express1.1标准规范

    - 定义(Definitions):提供了一系列与NVMe技术相关的专业术语和概念的解释,例如Admin Queue(管理队列)、命令完成(Command Completion)、控制器(Controller)等。 - 约定(Conventions):介绍了文档中使用的...

    WSDL1.1标准规范

    1. **定义(definitions)**:这是WSDL文档的根元素,包含了所有与服务相关的抽象描述和具体绑定。 2. **消息(messages)**:定义了服务中使用的消息结构,通常包含一组部分(parts),每个部分代表消息中的一个...

    Advanced-REST-client_v3.1.9+definitions.json

    《Advanced-REST-client_v3.1.9与definitions.json:深入理解REST API调试工具与定义文件》 在当今的Web开发领域,RESTful API已经成为构建分布式系统和微服务架构的标准接口设计模式。为了方便开发者测试和调试...

    definitions.JSON

    Chrome扩展AdvanceRestClient加载的json文件definitions.json

    chrome插件Advanced-REST-client及配置文件definitions.json

    6. **测试套件**:用户可以创建测试套件,包含一系列请求,进行自动化测试。 7. **安装使用文档**:通常会包含详细的步骤指南,帮助用户了解如何安装插件、配置环境和使用高级特性。 **definitions.json 配置文件*...

    advanced rest client definitions.json

    chrome浏览器安装advanced rest client插件时所需要的definitions.json文件,文件为txt格式,可以直接使用

    C#读取JPEG图片的Exif信息

    /// This method returns EXIF property values. /// /// <param name="exifCode">EXIF property to be returned. public string GetEXIFProperty(Definitions.exifCode exifCode) { // Declare local ...

    AdvanceRestClient插件的definitions.json文件

    - `method`: HTTP方法,如GET、POST、PUT等。 - `headers`: 请求头,包含了请求发送时的头部信息。 - `url`: API的URL模板,可以包含动态参数。 - `parameters`: 请求参数,包括查询参数、路径参数、表单数据等...

    5000 Collegiate Words with Brief Definitions and SAT Math Notes

    SAT 高频词汇含数学笔记。

    advanced-rest-client definitions.json

    例如,`method`字段指定HTTP方法,`url`字段存放API接口地址,`headers`字段包含请求头信息,`params`字段用于设置URL参数,而`body`字段则用于定义请求体内容。通过这种方式,用户可以预先定义好常用请求模板,快速...

    AdvanceRestClient加载的json文件definitions.json

    "method": "GET", "url": "http://api.example.com/users/1", "headers": { "Content-Type": "application/json" }, "params": {}, "body": {} }, "mySecondDefinition": { // 另一个定义... } } ``` 在...

Global site tag (gtag.js) - Google Analytics