我可以从ajax请求中删除X-Requested-With标头吗?
发布时间:2020-12-16 03:10:58 所属栏目:百科 来源:网络整理
导读:我想知道有没有人试图从jquery(或普通JS)的ajax请求中删除“X-Requested-With”头文件。可能吗? 第二部分:你知道Grease Monkey的ajax请求设置了这个头吗? 谢谢 标题看起来像这样: X-Requested-With XMLHttpRequest “2nd part: do you know if Grease Mo
我想知道有没有人试图从jquery(或普通JS)的ajax请求中删除“X-Requested-With”头文件。可能吗?
第二部分:你知道Grease Monkey的ajax请求设置了这个头吗? 谢谢 标题看起来像这样: X-Requested-With XMLHttpRequest
不,Greasemonkey’s GM_xmlhttpRequest()发出的默认请求看起来就像普通的浏览器请求。 GM_xmlhttpRequest ({ method: "GET",url: "http://google.com/",onload: function(response) {alert(response.responseText); } }); 看起来像我的数据包嗅探器: GET / HTTP/1.1 Request Method: GET Request URI: / Request Version: HTTP/1.1 Host: google.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 115 Connection: keep-alive Cookie: blah,blah,blah... (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |