title: $http headers is not a function - angularjs
body: <p>I am posting data to <code>Dynamics CRM</code> via <code>SOAP</code> on my PHP server with <code>cURL</code>. After this is done it is giving the entity <code>GUID</code> in the form of a HTTP Response header. When attempting to access this via my angular factory and <code>$http</code>.</p>
  
  <p>My header is exposed and is able to be viewed in Chrome Developer tools and gives me the <code>GUID</code> I need.</p>
  
  <p>The code for accessing the promise data is as follows:</p>
  
  <pre><code>        $http({
              method: 'POST',
              url: url,
              data: formData,
              headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
          }).success(function (data, headers) {
  
              var array = [];
              array.data = data;
              array.headers = headers('EntityId');
              console.log(array.headers);
  
              deferred.resolve(array);
          })
  
  return deferred.promise;
  
  //etc
  </code></pre>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>headers is not a function()</p>
  </blockquote>
  
  <p>I can however, access some header result such as a status 200 code by using:</p>
  
  <pre><code>array.headers = headers;
  </code></pre>
  
  <p>But I need to access my custom header. Any ideas on how I can achieve this?</p>