title: Is there a standard way in Spring to pass a body with a DELETE request to a REST endpoint?
body: <p>I am implementing a Spring client for an existing REST API and I need to invoke a DELETE while, at the same time, passing an access token in the request body, like this:</p>
  
  <pre><code>{ 
      "access_token": "..."
  }
  </code></pre>
  
  <p>The problem is that, using the method that works for POST, the transmitted body is empty (I have intercepted the request body and made sure) and I cannot be authorised without this access token. This is what I am doing:</p>
  
  <pre><code> RestTemplate restTemplate = new RestTemplate();
   UserRequest ur = new UserRequest(access_token);
   HttpEntity&lt;UserRequest&gt; entity = new HttpEntity&lt;&gt;(ur);                                               
   restTemplate.delete(url, entity);
  </code></pre>
  
  <p>I have no control over the API itself, so I don't have the option of passing the token as url parameter.</p>
  
  <p>Is there a way to do this in Spring, or do I have to build my own HttpUrlConnection like described for instance in <a href="https://stackoverflow.com/a/20075713">this SO answer</a>?</p>