title: How to set default header values in Angular Resource?
body: <p>The following approach does not work:</p>
  
  <pre><code>angular.module('myApp.myModule').factory('MyResource', function($resource, $cookies) {
  
      var token = $cookies.get('token');
      var user = $cookies.get('username');
  
      console.log ("Token: "+token+" User: "+user);
  
      return $resource(
          'http://my-rest-api/whatever/:id',
          {
              headers: {
              'token': token,
              'user': user
              }
          }
  )});
  </code></pre>
  
  <p>Console shows the correct data, but they were not sent..</p>
  
  <p>That's the part somewhere in the related Controller (excerpt):</p>
  
  <pre><code>var getEntryOne = MyResource.get({ id: 1 }, function() {
      console.log("Result: "+getEntryOne);
  });
  </code></pre>
  
  <p>I get the "Message: Token invalid", I see the request-http-headers in firebug, they were not setted. </p>