Franco Manzur Franco Manzur - 7 months ago 33
Javascript Question

AngularJS - get headers in response

I'm doing a

request to a https service which has an XML file and it need the
to know it size.

This's my code:

method : "GET",
url : ""
function sCallback(data, status, headers, config, statusText) {

console.log( headers('Content-Length') );

}, function eCallback(data, status, headers, config, statusText) {

$log.warn(data, status, headers, config, statusText);


The result of the request is:
"headers is not a function"
Is there another way to get it?


 console.log( data.headers('Content-Length'));
 console.log( data.headers('Content-type'));