试图通过角度拦截器读取所有响应头

时间:2014-09-30 15:51:34

标签: javascript angularjs debugging angularjs-scope

我正在尝试通过$ httpProvider拦截器读取响应头来读取所有ajax请求的所有头。

$httpProvider.interceptors.push(['$q',function($q) {
    'response': function(response) {
            console.log("=====");
            console.log(response);
            console.log("=====");
     }
}]);  

通过这种方式我可以在Chrome调试器上看到我可以看到:

enter image description here

我想访问标题字段,读取“b”属性,其中包含标题响应的'stringify'代表(下面的屏幕截图显示了网络中的chrome调试器>> XHR表示相同的响应标头)

enter image description here

如何阅读“b”属性?也许有另一种方法可以做到这一点?

0 个答案:

没有答案
相关问题