title: How to ensure that angular $resource uses the following angular $http settings?
body: <p>I am using CakePHP as my backend.</p>
  
  <p>Therefore, if I use <code>$http</code>, I need to have the following:</p>
  
  <p>a) the default config must be</p>
  
  <pre><code>angularApp.config(function ($httpProvider) {
    $httpProvider.defaults.headers.common['Content-Type'] = 'application/x-www-form-urlencoded';
    $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
    $httpProvider.defaults.headers.common['Accept'] = 'application/json';
    $httpProvider.defaults.transformRequest = function(data) {
        if (data === undefined) {
            return data;
        }
        return $.param(data);
    }
  });
  </code></pre>
  
  <p>b) the <code>ng-model</code> attribute in the html input must be of the pattern</p>
  
  <pre><code>ng-model="data.User.email"
  </code></pre>
  
  <p>In other words, <code>data.{CakePHPModelName}.{modelattribute}</code></p>
  
  <p><strong>My $http is working perfectly with the CakePHP backend.</strong></p>
  
  <p>How do I use the angular $resource to be just as successful?</p>