我的服务器发送自定义的报头以及响应。我得到的响应数据好了,但我不能用jQuery的 getAllResponseHeaders()访问自定义标题
或AngularJS $ HTTP
服务。我得到的是内容类型
。当我检查与DevTools或小提琴手请求响应,我可以看到被送到服务器所有自定义标题,但我不能从XHR得到他们。有什么办法来访问所有的头?
My server sends custom headers along with the response. I get the response data alright, but I can't access the custom headers with jQuery's getAllResponseHeaders()
or AngularJS $http
service. All I get is content-type
. When I inspect the request response with DevTools or fiddler, I can see all the custom headers being sent by the server, but I can't get them from xhr. Is there any way to access all the headers?
确定我得到这个工作在我的服务器配置加入让头后访问控制 - 揭露-头
OK I got this working after adding allowed headers in my server config Access-Control-Expose-Headers
上一篇:在阿贾克斯后缺少参数ASMX参数、阿贾克斯后、ASMX
下一篇:我如何能突出使用Primefaces UIInput时,在Ajax请求验证失败?突出、Primefaces、Ajax、UIInput