向所有非jQuery AJAX请求添加标头

时间:2016-01-13 13:08:54

标签: javascript ajax http-headers xmlhttprequest

我知道我可以为所有jQuery AJAX请求添加标头,如下所述: How can I add a custom HTTP header to ajax request with js or jQuery?

在这里: Add custom http header to all jQuery AJAX Requests

我有很多没有jQuery编写的代码,我想知道是否有办法在服务器上自动添加标头到所有非jQuery ajax请求,而无需编辑/修改每个请求代码都单独使用xmlhttp.setRequestHeader("Header-name", "Header-value");

0 个答案:

没有答案
相关问题