title: Stream upload 'POST' in Spring WebClient
body: <p>I am uploading streams of (raw bytes) data using HTTP posts using WebClient:</p>
  
  <pre><code>    final byte[] rawData = IOUtils.toByteArray(sourceInputStream);
      webClient.post()
               .uri(uri)
               .contentType(MediaType.APPLICATION_OCTET_STREAM)
               .bodyValue(rawData)
               .exchange()...
  </code></pre>
  
  <p>I am concerned there is a potentially a lot of memory used given sometimes these objects can be quite big (~200Mb) so would like to read directly from the InputStream and upload as a stream.</p>
  
  <p>I tried:</p>
  
  <pre><code> bodyValue(BodyInserters.fromResource(new InputStreamResource(inputStream))) 
  </code></pre>
  
  <p>but got exception Content type 'application/octet-stream' not supported for bodyType=org.springframework.web.reactive.function.BodyInserters</p>
  
  <p>So I then tried removing the header but the data is then corrupted.</p>
  
  <p>Is there a way to stream the data without passing through the in memory 'buffer' rawData[]?</p>
  
  <p>Thanks</p>