我正在通过 POST 方法在 Safari 中加载一个 JSON 文件。
第一页加载显示 JSON 内容,所有下一页加载不会再次加载 JSON 文件。
Safari 控制台内的错误消息:
Failed to load resource: the server responded with a status of 412 (Precondition Failed)
在 Firefox、Chrome 或 IE 中,我可以随时加载 JSON 文件。
似乎有一个解决方案:http://avnwx.blogspot.co.at/2011/10/debuggers-lie.html
Seems to me the best solution would be to allow server to return 304 Unmodified... If I send a conditional request and the response hasn't changed from an earlier response, the 304 fits the bill.
如何告诉服务器返回 304 Unmodified
?
最佳答案
将您的 POST 请求更改为 GET
关于javascript - Safari加载JSON文件响应421错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18551279/