title: Spring boot RestTemplate - multipart/mixed
body: <p>Have a REST API which only accepts content type multipart/mixed.</p>
  
  <p>Trying to use restTemplate and generate REST request with content type multipart/mixed.
  If I comment setContentType restTemplate defaults to multipart/form-data.</p>
  
  <pre><code>setContentType(MediaType.parseMediaType("multipart/mixed"))
  </code></pre>
  
  <p>But no luck, any example how I can call API generating multipart/mixed request?</p>
  
  <p>Maybe this helps</p>
  
  <pre><code>HttpHeaders publishHeaders = new HttpHeaders();
  publishHeaders.set(HEADER_TABLEAU_AUTH, token);
  publishHeaders.setContentType(MediaType.parseMediaType("multipart/mixed"));
  String response;
  LinkedMultiValueMap&lt;String, Object&gt; map = new LinkedMultiValueMap&lt;&gt;();
  String payload = "&lt;tsRequest&gt;\n" +
          ............................
         "&lt;/tsRequest&gt;";
  map.add(TABLEAU_PAYLOAD_NAME, payload);
  map.add("tableau_datasource", new FileSystemResource("/extract/test.tde"));
  HttpEntity&lt;LinkedMultiValueMap&lt;String, Object&gt;&gt; entity = new HttpEntity&lt;&gt;(map, publishHeaders);
  try {
  response = restTemplate.postForObject(url + PUBLISH_DATASOURCE_SINGLE_CHUNK, entity, String.class, siteId);
  } catch (RestClientException restEx) {
     log.error(....);
     throw restEx;
  }
  </code></pre>