小编tez*_*zqa的帖子

如何从角度资源获取完整的响应头

我正在发送一个Angular $资源的请求:

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...
        })
Run Code Online (Sandbox Code Playgroud)

但我只得到几个标题:

{content-type: "application/json", cache-control: "no-cache, max-age=604800", expires: "Mon, 06 Apr 2015 16:21:17 GMT"}
Run Code Online (Sandbox Code Playgroud)

当我想要抓住标题"X-Token"(如果我在浏览器控制台中检查就会收到)

有没有想过从Angular和$ resource接收完整的标题列表?

http-headers angularjs angular-resource

5
推荐指数
1
解决办法
1740
查看次数

标签 统计

angular-resource ×1

angularjs ×1

http-headers ×1