我正在使用Apiary.io来模拟我的API。但是不知怎么的,我无法使用AngularJS从响应对象中读取任何标头。我确定我至少已经正确设置了Content-Type: application/json,因为我在firebug中检查过了。在Angular中的代码也应该能够正确读取标头,因为当我向apiary.io之外的地方发送请求时,我可以将它们打印出来。
$http.get('http://ies.apiary.io/some').then(function(response) {
console.log("ok",response.headers('Content-Type'));
},function(response){console.log("err",response);});