Is it possible to send custom headers with an XHR (“Ajax” request)?

大憨熊 提交于 2019-12-18 08:25:57

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/1180048/is-it-possible-to-send-custom-headers-with-an-xhr-ajax-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!