JS库请求的常见HTTP头是什么? [英] What is the common HTTP header for request by JS libs?

查看:210
本文介绍了JS库请求的常见HTTP头是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用原型JavaScript框架我注意到,Ajax请求中包含一个名为 X-请求-随着

Using the Prototype JavaScript framework I've noticed, that the Ajax requests are enriched with a header called X-Requested-With.

其他JavaScript库如jQuery,dojo和YUI是否会在其Ajax请求中添加标头?它总是被称为 X-Requested-With ?这是标准吗?

Do other JavaScript libraries like jQuery, dojo and YUI add headers to their Ajax requests? Is it always called X-Requested-With? Is this a standard?

Prototype的完整标题:

The full header by Prototype:

X-Requested-With:     XMLHttpRequest
X-Prototype-Version:  1.5.0_rc0


推荐答案

默认情况下,X-Requested-With标头由以下框架发送:

The X-Requested-With header is sent by default by the following frameworks:


  • Dojo

  • ExtJS

  • jQuery

  • MooTools

  • Node.js

  • 原型

  • YUI

  • Dojo
  • ExtJS
  • jQuery
  • MooTools
  • Node.js
  • Prototype
  • YUI

像往常一样,保持请注意,框架发送它不是强制性的,有时框架的用户可以覆盖它,客户端/防火墙/代理/服务器可能会影响它,甚至还有已知的浏览器错误

As usual, keep in mind that it is not mandatory for frameworks to send it, that sometimes the framework's user can override it, that client/firewall/proxy/server may affect it, and there are even known browser bug(s) for it.

这篇关于JS库请求的常见HTTP头是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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