在 angular 中获得 post 请求的响应 headers

Get response headers of post request in angular

我正在尝试在 Angular 中发出一个简单的 post 请求并在 header 中获取响应。问题是我得到了 header:

的回复
function (d){b||(b=fd(a));return d?(d=b[G(d)],void 0===d&&(d=null),d):b}

Angular代码:

$http.get(url).success(function(data, status, headers, config) {
    callback(data, status, headers, config);
});

我错过了什么?

我的同事找到了答案: 响应是一个函数,因此应该 运行 作为一个函数。 所以为了获得 headers 的值,我使用了这个:

$scope.results = headers();

AngularJs v1.7.5

 $http({
      ...
      }).then(function success(data) {
            var heder=data.headers();
         }