Authentication:76efbc0946773b62c93e952b502a47acd898200f6f80dc46ac87ffc501c00780
当我用检查器检查请求时,我的http响应包含标头Authentication(如此处所述:),但调用headers("Authentication")
returnnull
return $http({
method: "GET",
url: url,
headers: {
'Content-Type': "application/json"
}
}).success(function (data, status, headers, config) {
console.log(headers("Authentication"));
})
您对我可能做错了什么有任何想法吗?
仅供参考,我尝试使用将其切换回“承诺”方式,.then
问题仍然相同。
您的代码看起来不错,但如果是CORS请求,则服务器需要在响应中包括Access-Control-Expose-Headers:{any custom headers}。
之前有一个问题/解答,提供了更多详细信息:使用Angularjs的$ http时读取响应标头
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句