ajax的请求和在地址栏输入请求有什么不同?

核子hezi 核子hezi 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有ajax请求 总是反回404 而在地址栏输入url 正常返回; 两具请求头为:


ajax:
Request URL:http://localhost:81/proxy/weibo.gxq.com.cn/game/getRealstock
Request Method:GET
Status Code:404 Not Found
Request Headersview parsed
GET /proxy/weibo.gxq.com.cn/game/getRealstock HTTP/1.1
Host: localhost:81
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
X-Requested-With: XMLHttpRequest
Referer: http://localhost:81/doc/cow/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=4ijp4pd5eu10cnljrd0sit9eu4; gxqSignId=d984aea7fcb3ac93; outer_referer=http%3A%2F%2Flocalhost%3A81%2Fdoc%2Fcow%2Findex.html
Response Headersview parsed
HTTP/1.1 404 Not Found
Date: Mon, 25 Nov 2013 15:22:47 GMT
Server: nginx/1.2.0
Content-Type: text/html; charset=utf-8
X-Powered-By: PHP/5.4.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Content-Encoding: gzip
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked



地址栏输入:

Request URL:http://localhost:81/proxy/weibo.gxq.com.cn/game/getRealstock
Request Method:GET
Status Code:200 OK
Request Headersview parsed
GET /proxy/weibo.gxq.com.cn/game/getRealstock HTTP/1.1
Host: localhost:81
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=4ijp4pd5eu10cnljrd0sit9eu4; gxqSignId=d984aea7fcb3ac93; outer_referer=http%3A%2F%2Flocalhost%3A81%2Fdoc%2Fcow%2Findex.html
Response Headersview parsed
HTTP/1.1 200 OK
Date: Mon, 25 Nov 2013 15:15:45 GMT
Server: nginx/1.2.0
Content-Type: text/html; charset=utf-8
X-Powered-By: PHP/5.4.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Content-Encoding: gzip
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked




找了一晚上,都找不出问题所在. 求大神帮助
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
核子hezi
Ajax 52,778 成员 25,334 内容