【问题标题】:Where does the HTTP Request Header X-Requested-With come fromHTTP Request Header X-Requested-With 来自哪里
【发布时间】:2014-03-12 01:10:59
【问题描述】:

我们知道我们可以使用X-Requested-Withhttp请求头来判断http请求是否来自Ajax。

许多javascript框架会在他们的ajax请求中自动添加X-Requested-With标头,例如jQuery AjaxPrototype Ajax。正如List of HTTP header fields的wiki所说X-Requested-With是一个非标准请求标题

google了很多遍,都没有找到X-Requested-With这个请求头是谁最先提出来的。

所以我想知道是否有人知道X-Requested-With 来自哪里?谢谢...

【问题讨论】:

    标签: http-headers xmlhttprequest


    【解决方案1】:

    对支持X-Requested-With 的原型的引用可以在Should there be a standard X-Ajax-Engine request header? 中找到(发布于 2006 年 6 月 30 日)。

    在 Github 上的 jQuery 源代码存储库中对 ajax.js 的 2006 年 5 月 16 日版本的引用,其中最初添加了 X-Requested-With

    Dojo 直到 02/09/08 才看到添加它并引用了其他库:

    jQuery、Prototype、YUI 和 - 看起来 - Mootools 发送标题 “X-Requested-With: XMLHttpRequest”和他们的 XHR。

    2008-10-21 v1.4,MochiKit 将此称为标准:

    MochiKit.Async 现在设置“X-Requested-With: XMLHttpRequest”标头, 一个事实上的标准(Prototype、jQuery、Mootools)。

    【讨论】:

      猜你喜欢
      • 2010-10-12
      • 2021-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多