412 Precondition Failed

您所在的位置:网站首页 状态码返回412 412 Precondition Failed

412 Precondition Failed

2024-07-17 21:33| 来源: 网络整理| 查看: 265

With the help of the ETag and the If-Match headers, you can detect mid-air edit collisions.

For example, when editing MDN, the current wiki content is hashed and put into an Etag in the response:

httpETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"

When saving changes to a wiki page (posting data), the POST request will contain the If-Match header containing the ETag values to check freshness against.

httpIf-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4"

If the hashes don't match, it means that the document has been edited in-between and a 412 Precondition Failed error is thrown.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3