title: What is a clean way to send a body with DELETE request?
body: <p>I need to send a request body with my DELETE requests using <a href="http://docs.angularjs.org/api/ngResource.$resource" rel="noreferrer">$resource</a></p>
  
  <p>The only way I could see to do this was to change:</p>
  
  <p><a href="https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js" rel="noreferrer">https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js</a> </p>
  
  <p><strong>From</strong></p>
  
  <pre><code>var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH';
  </code></pre>
  
  <p><strong>To</strong></p>
  
  <pre><code>var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH' || action.method == 'DELETE';
  </code></pre>
  
  <p>Is there a better way to override this? Like when you alter the content type header you can do:</p>
  
  <pre><code>$httpProvider.defaults.headers["delete"] = {'Content-Type': 'application/json;charset=utf-8'};
  </code></pre>
  
  <p>Or something similar... Ive googled this but maybe Ive missed something obvious (not for the first time). Thanks for any help in advance.</p>