美文网首页
HTTP协议-安全和幂等方法

HTTP协议-安全和幂等方法

作者: nzdxwl | 来源:发表于2019-12-16 00:14 被阅读0次

Http协议官网

9.1 Safe and Idempotent Methods

9.1.1 Safe Methods

Implementors should be aware that the software represents the user in their interactions over the Internet, and should be careful to allow the user to be aware of any actions they might take which may have an unexpected significance to themselves or others.

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".
需要强调的是,已发布的约定指明GET和HEAD方法不应当包含除了检索(取回)外的其他动作,这些方法应当被认为是“安全的”。

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.
这允许用户代理使用特殊的方式来表现其他方法,例如POST、PUT和DELETE,使得用户认识到正在请求一个可能不安全的操作。

Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; in fact, some dynamic resources consider that a feature. The important
distinction here is that the user did not request the side-effects, so therefore cannot be held accountable for them.

9.1.2 Idempotent Methods

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.
当单一请求的副作用跟N>0次Http协议官网

9.1 Safe and Idempotent Methods

9.1.1 Safe Methods

Implementors should be aware that the software represents the user in their interactions over the Internet, and should be careful to allow the user to be aware of any actions they might take which may have an unexpected significance to themselves or others.

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".
需要强调的是,已发布的约定指明GET和HEAD方法不应当包含除了检索(取回)外的其他动作,它们应当被认为是“安全的”。

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.
这允许用户代理使用特殊的方式来表现其他方法,例如POST、PUT和DELETE,使得用户认识到正在请求一个可能不安全的操作。

Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; in fact, some dynamic resources consider that a feature. The important
distinction here is that the user did not request the side-effects, so therefore cannot be held accountable for them.

9.1.2 Idempotent Methods

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.
当对方法进行单一请求的副作用跟进行N>0次相同请求时每次的副作用一样时,我们也可以认为这个方法拥有“幂等”的属性。GET、HEAD、PUT和DELETE均有这个属性。而方法OPTIONS和TRACE则是不应当有副作用,所以它们是天然幂等的。

相关文章

  • HTTP的安全性和幂等性(转)

    原文HTTP方法的安全性和幂等性Http协议规定了不同方法的安全特性和幂等特性,作为服务提供者的服务器必需为客户端...

  • HTTP协议-安全和幂等方法

    Http协议官网 9.1 Safe and Idempotent Methods 9.1.1 Safe Metho...

  • HTTP中GET和POST的区别

    一、论点 1.Get用于信息获取,http协议要求安全性和幂等性,Post请求用于更新和修改服务的资源,不具有幂等...

  • 安全与幂等

    安全: HTTP 协议里的安全是指 请求方法不会破坏服务器上的资源,对资源不会造成实质性的破坏 幂等:多次操作服务...

  • HTTP修炼手册-幂等/安全方法

    哪些叫幂等或/且安全的方法? 安全方法是指不修改资源的 HTTP 方法。譬如,当使用 GET 或者 HEAD 作为...

  • 网络相关问题

    (1)Http Get和Post方法 GET:无副作用,幂等,不可带 Request BodyPUT:副作用,幂等...

  • Kafka事务分析

    Kafka 幂等性 Kafka幂等性含义幂等性起初是在HTTP协议中定义,是指一次和多次请求同一个资源对资源本身应...

  • RESTFul API设计

    要定义一个严谨的REST统一接口,就需要真正理解HTTP方法的安全性和幂等性。安全性代表安全的REST接口,是指外...

  • 防止重复下单和幂等模式的应用

    重复下单 HTTP的幂等性 HTTP方法的幂等性是指一次和多次请求某一个资源应该具有同样的结果。在HTTP 1.1...

  • 【HTTP】幂等性

    HTTP方法的幂等性是指一次和多次请求某一个资源应该具有同样的副作用 幂等的 HTTP 方法,同样的请求被执行一次...

网友评论

      本文标题:HTTP协议-安全和幂等方法

      本文链接:https://www.haomeiwen.com/subject/dexhnctx.html