javascript - Safari加载JSON文件响应421错误

标签 javascript json apache safari

我正在通过 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/

相关文章:

javascript - 对象继承

regex - 正则表达式捕获和替换可以与 Apache DirectoryMatch 指令一起使用吗?

python - 在 Ubuntu LAMP 服务器上设置 Apache 以在虚拟主机中执行 Python

perl - XML::LibXSLT 间歇性地抛出样式表编译错误

WebBrowser 中的 Javascript 控制台

javascript - 带有 Firefox(最新 32 位)浏览器的 Protractor 未加载

javascript - 使用 Jquery 列出项目的复选框值

json - 无法将字符串解码到 Go struct 字段 Article.article_type of type models.ArticleType

java - 如何将包含数组的 JSON 转换为 Java 对象

json - DOJO json布局结构不起作用