【发布时间】:2015-03-30 16:47:23
【问题描述】:
我正在发送一个带有 Angular $resource 的请求:
myResource.get({ foo: bar }, function success(data, headers) {
console.log("data:", data); // Prints data
console.log("headers:", headers()); // Prints only few headers
}, function failure(response, status) {
// Handling failure here...
})
但我只得到几个标题:
{content-type: "application/json", cache-control: "no-cache, max-age=604800", expires: "Mon, 06 Apr 2015 16:21:17 GMT"}
当我想捕获标题“X-Token”时(如果我在浏览器控制台中检查就会收到)
知道从 Angular 和 $resource 接收完整的标头列表吗?
【问题讨论】:
标签: angularjs http-headers angular-resource