title: How to send a body with HTTP DELETE when using WebFlux?
body: <p>I want to access an HTTP API which provides a <code>DELETE</code> endpoint. This particular endpoint expects a list of items (which I want to delete) as JSON body.</p>
  
  <p>Now, my problem is, I'm using Spring Webflux. But its <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/reactive/function/client/WebClient.html" rel="noreferrer">WebClient</a> doesn't give me the possibility, to send a body with a <code>DELETE</code> request. For a <code>POST</code>, I'd do this:</p>
  
  <pre><code>webClient.post()
           .uri("/foo/bar")
           .body(...)
           .exchange()
  </code></pre>
  
  <p>But for <code>DELETE</code>, I get a <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/reactive/function/client/WebClient.RequestHeadersSpec.html" rel="noreferrer">RequestHeadersSpec</a> which doesn't give me the option to provide a <code>body(...)</code>:</p>
  
  <pre><code>webClient.delete()
           .uri("/foo/bar")
           .body(...)       &lt;--- METHOD DOES NOT EXIST
           .exchange()
  </code></pre>
  
  <p>So, what's the way to achieve this with Spring Webflux on the client side?</p>