2

I’m doing a $http.get request to a https service which has an XML file and it need the headers('Content-length') to know it size.

This’s my code:

$http({
    method : "GET",
    url : "https://url.com/xml_file.xml"
}).then(
  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?