If-Match标题的正确行为? [英] Correct behavior with If-Match the header?

查看:133
本文介绍了If-Match标题的正确行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 RFC 2616 ,HTTP服务器生成实体标签是可选的。但是,如果收到 If-Match (或),我找不到有条件兼容的HTTP服务器应该做什么If-None-Match )标题。它应该忽略这些标题还是应该用 412前提条件失败来响应?

According to RFC 2616, generation of entity tags by HTTP servers is optional. However, I couldn't find what a conditionally compliant HTTP server should do if it receives an If-Match (or If-None-Match) header. Should it just ignore those headers or should it respond with 412 Precondition Failed?

UPD:为了澄清,我假设有问题的服务器不支持实体标签。

UPD: Just to clarify, I'm assuming that the server in question does not support entity tags.

推荐答案

虽然RFC2616隐含在此事上,但您可以推断出,如14.26(If-None-Match),如果服务器无法将资源与标签匹配,那么它应该继续请求)。基于我对RFC2616的理解,412代码适用于修改状态的请求(例如PUT,POST,DELETE)。
因此,实质上,如果标记不匹配(并且在服务器端不存在时只是许多可能情况中的一种),那么服务器应该继续请求。

While the RFC2616 is implicit on the matter, you can deduce from, say 14.26 (If-None-Match), that if the server cannot match the resource with the tag, then it should go ahead with request). The 412 code, based upon my understanding of RFC2616 is intended for requests which modify state (e.g. PUT, POST, DELETE). So, in essence, if the tag doesn't match (and when it's absent on server side is only one of many possible scenarios), then the server should go ahead with the request.

这篇关于If-Match标题的正确行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆