title: Missing Content-Length header sending POST request with WebClient (SpringBoot 2.0.2.RELEASE)
body: <p>I'm using WebClient (SpringBoot 2.0.2.RELEASE) to send a POST with <strong>SOAP</strong> request, but it is missing "<strong>Content-Length</strong>" header required by the legacy API. </p>
  
  <p>Is it possible to configure WebClient to include "<strong>Content-Length</strong>" header?
  There is an <a href="https://jira.spring.io/browse/SPR-16542" rel="nofollow noreferrer">Spring Framework Issue</a> resolved and introduced for <strong>EncoderHttpMessageWriter</strong> in SpringBoot 2.0.1, but it seems not to work for JAXB.</p>
  
  <p>I tried to use <code>BodyInserters</code>:</p>
  
  <pre><code>webClient.post().body(BodyInserters.fromObject(request)).exchange();
  </code></pre>
  
  <p>and <code>syncBody</code>:</p>
  
  <pre><code>webClient.post().syncBody(request).exchange();
  </code></pre>
  
  <p>None of them worked for <code>WebClient</code>. Though, when <code>RestTemplate</code> is used, <strong>Content-Length</strong> is set and API responds with success</p>