最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is it possible to send custom headers with an XHR ("Ajax" request)? - Stack Overflow

programmeradmin3浏览0评论

I'm working with an API which needs extra security information sent along with an HTTP request as meta-information in headers. Is it possible to set those in an XMLHttpRequest?

I'm working with an API which needs extra security information sent along with an HTTP request as meta-information in headers. Is it possible to set those in an XMLHttpRequest?

Share Improve this question asked Jul 24, 2009 at 20:38 Andrey FedorovAndrey Fedorov 9,68922 gold badges69 silver badges99 bronze badges 1
  • To anyone visiting from Google: setRequestHeader is now part of the spec: developer.mozilla/en-US/docs/Web/API/XMLHttpRequest/… – Sumit Commented Aug 7, 2018 at 4:04
Add a ment  | 

1 Answer 1

Reset to default 15

Yes, see "The setRequestHeader() method" of the current XMLHttpRequest working draft of 6 December 2012.

发布评论

评论列表(0)

  1. 暂无评论