带有If-Modified的XmlHttpRequest,因为网络服务器返回"400 Bad Request", [英] XmlHttpRequest with If-Modified since, webserver returns "400 Bad Request"

查看:112
本文介绍了带有If-Modified的XmlHttpRequest,因为网络服务器返回"400 Bad Request",的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我使用以下代码时,网络服务器(运行IIS 7)都会拒绝向我发送内容,而是发送"400错误请求".

Whenever I use the following code, the webserver (running IIS 7) refuses to send me content, but sends a "400 Bad Request" instead.

request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

推荐答案

显然,很多人都遇到了这个问题,可以通过在日期前加上0来解决此问题.

Apparently many people are having this problem, and it can easily be fixed by prefixing the date with a 0.

request.setRequestHeader("If-Modified-Since", "Sat, 01 Jan 2000 00:00:00 GMT");

这篇关于带有If-Modified的XmlHttpRequest,因为网络服务器返回"400 Bad Request",的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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