4.2. 412 Precondition Failed

0 阅读1分钟

4.2. 412 Precondition Failed

rfc 7232

没有在rfc中找到当返回412时,response应该是怎么样的。下面是实践中的例子:

HTTP/1.1 412 Precondition Failed
ETag: "version-2"  <-- 告诉客户端:现在已经是 version-2 了
Content-Type: application/json

{
  "error": "Precondition Failed",
  "message": "The resource has been modified by another user.",
  "current_etag": "version-2"
}