title: Create a Multipart Request from multiple HTTP responses
body: <p>I have to create a multipart/form-data HTTP request where the file will be received from one request, some additional form data values from different requests. Example:</p>
  
  <p>1) HTTP listener receives the file as attachment 
  <br/>2) Sends HTTP requests to 3 or more REST APIs, and stores values into property variables
  <br/>3) Create a HTTP request with the file received in step 1 along with values received in step 2</p>
  
  <p>When I receive the file in step 1 I save it in a property, I also save values from subsequent requests into different properties.</p>
  
  <p>Now When I construct a HTTP POST request from these properties in Step 3 I don't receive any values on the server, neither the fields nor the file.</p>
  
  <p>My Flow:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;http:request-config name="HTTP_poster_Configuration" host="localhost" port="53536"  doc:name="HTTP Poster Configuration"/&gt;
  &lt;http:request-config name="HTTP_Request_Configuration" host="1.1.1.1"  basePath="/xyz" port="8080"  doc:name="HTTP Request Configuration"/&gt;
      &lt;http:listener-config  name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/&gt;
     
     
      &lt;flow name="getticketFlow"&gt;
          &lt;http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/&gt;
  
  
          
  
          &lt;set-session-variable variableName="var1" value="NA" doc:name="Session Variable" /&gt;
         
           &lt;set-variable variableName="var2" value="P11335577" doc:name="Flow name Variable" /&gt;
            &lt;set-variable variableName="var3" value="Goku" doc:name="Flow title Variable" /&gt;
             &lt;set-variable variableName="var4" value="Saiyan Dead but Alive" doc:name="Flow description Variable" /&gt;
             
    &lt;set-variable variableName="uploadFile" value="#[message.inboundAttachments['file'].dataSource.content]" doc:name="Flow type Variable" /&gt; 
               
  .................Sending requests to other services
  ...................Setting property Variables    
  
  &lt;!--    Finally --&gt;
    &lt;http:request  config-ref="HTTP_poster_Configuration"  path="/handler" method="POST" doc:name="Uploading_Doc"  &gt; 
               &lt;http:request-builder&gt;
                  &lt;http:query-param paramName="filedata" value="#[flowVars ['uploadFile']]"/&gt;
              
                  &lt;http:query-param paramName="sid" value="#[flowVars ['var1']]"/&gt;
                  &lt;http:query-param paramName="cid" value="#[flowVars ['var2']]"/&gt;
                  &lt;http:query-param paramName="udi" value="#[flowVars ['var3']]"/&gt;
  
                  &lt;http:header headerName="Content-Type" value="multipart/form-data"/&gt;
               &lt;/http:request-builder&gt;
             
          
           &lt;/http:request&gt;
   
           
         
      &lt;/flow&gt;
  &lt;/mule&gt;</code></pre>
  </div>
  </div>
  </p>