user5331188 user5331188 - 3 months ago 45
AngularJS Question

Get response headers of post request in angular

I'm trying to make a simple post request in Angular and acquire the response the headers. The problem is I get this response for the header:

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

Angular code:

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

What am I missing?


My colleague found the answer: the response was a function so should therefore be run as a function. So to get the value of the headers I used this:

$scope.results = headers();