title: CamelHttp multipart/form-data upload. Changes between camel-http4 and camel-http-starter
body: <p>I have a Spring Boot app that uses Camel to POST a multipart/form-data request to a REST endpoint. The request includes a text part and a file part. The code that builds the request is as follows:</p>
  
  <pre><code>@Override
  public void process(Exchange exchange) throws Exception {
      @SuppressWarnings("unchecked")
      Map&lt;String, String&gt; body = exchange.getIn().getBody(Map.class);
      String fileName = body.get("FILE_NAME");
      String filePath = body.get("FILE_PATH");
      MultipartEntityBuilder entity = MultipartEntityBuilder.create();
      entity.addTextBody("name", fileName, ContentType.DEFAULT_TEXT);
      entity.addBinaryBody("file", new File(filePath), 
      ContentType.APPLICATION_OCTET_STREAM, fileName);
      exchange.getIn().setBody(entity.build());
  }
  .to("https4://&lt;endpoint&gt;")
  </code></pre>
  
  <p>This code works nicely.
  In my pom.xml file I am importing the camel-http4 component:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
      &lt;artifactId&gt;camel-http4&lt;/artifactId&gt;
      &lt;version&gt;${camel.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I have tried replacing the camel-http4 component with camel-http-starter, as suggested by the latest Camel documentation at <a href="https://camel.apache.org/components/latest/http-component.html" rel="nofollow noreferrer">https://camel.apache.org/components/latest/http-component.html</a></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
      &lt;artifactId&gt;camel-http-starter&lt;/artifactId&gt;
      &lt;version&gt;${camel.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and replace all http4 endpoints with http, but the code above now fails because there is no type converter available between HttpEntity and InputStream in the camel-http component.</p>
  
  <p>I have tried using Camel's MIME Multipart DataFormat:</p>
  
  <pre><code>.setHeader("name", simple("${body[FILE_NAME]}"))
  .process(new Processor() {
      @Override
      public void process(Exchange exchange) throws Exception { 
          @SuppressWarnings("unchecked")
          Map&lt;String, String&gt; body = exchange.getIn().getBody(Map.class);
          String filePath = body.get("FILE_PATH");
          exchange.getIn().setBody(new File(filePath));
      }
  })
  // Add only "name" header in multipart request
  .marshal().mimeMultipart("form-data", true, true, "(name)", true)
  .to("https://&lt;endpoint&gt;")
  </code></pre>
  
  <p>But I keep getting HTTP 400 errors from the server, meaning it doesn't understand the request.
  So my question is:
  How to use the MIME Multipart DataFormat (or any other way) to obtain the same multipart request as the previous working code?</p>