title: Make POST request from Mule ESB
body: <p>I'm stuck with making correct HTTP request to web server (running under PHP).
  I need to send POST request with property <code>json</code> and some value, for example <code>{ "employee_id":191, "date":"2015-08-11", "time":"14:26:00" }</code>.</p>
  
  <p>It's working if I make a request from Postman or cURL for example, the request will look something like this</p>
  
  <pre><code>POST /DeliveryDetails/ HTTP/1.1
  Host: 192.168.0.100:80
  Cache-Control: no-cache
  Content-Type: application/x-www-form-urlencoded
  
  json=%7B+%22employee_id%22%3A191%2C+%22date%22%3A%222015-08-11%22%2C+%22time%22%3A%2214%3A26%3A00%22+%7D
  </code></pre>
  
  <p>Also I can send with conntent type <code>multipart/form-data</code></p>
  
  <pre><code>POST /DeliveryDetails/ HTTP/1.1
  Host: 192.168.0.100:80
  Cache-Control: no-cache
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  
  ----WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="json"
  
  { "employee_id":191, "date":"2015-08-11", "time":"14:26:00" }
  ----WebKitFormBoundary7MA4YWxkTrZu0gW
  </code></pre>
  
  <p>or with cURL</p>
  
  <pre><code>curl -d "json={ \"employee_id\":191, \"date\":\"2015-08-11\", \"time\":\"14:26:00\" }" http://192.168.0.100:80/DeliveryDetails/
  </code></pre>
  
  <p>But when I'm trying to make request from Mule ESB it's not working since the request is incorrect.</p>
  
  <p>The flow looks like this</p>
  
  <pre><code>&lt;sub-flow name="my-flow"&gt;
      &lt;logger message="Request: #[payload]" level="INFO" doc:name="Log request"/&gt;
      &lt;http:request config-ref="request-HTTP" path="/DeliveryDetails/" method="POST" doc:name="HTTP call" /&gt;
      &lt;object-to-string-transformer doc:name="Object to String"/&gt;
      &lt;logger message="Response: #[payload]" level="INFO" doc:name="Log response"/&gt;
  &lt;/sub-flow&gt;
  </code></pre>
  
  <p><code>#[payload]</code> contains the value <code>{ "employee_id":191, "date":"2015-08-11", "time":"14:26:00" }</code> 
  and if I do it like this the body would simply contain it (without additional information like <code>Content-Type</code>, I think thats the problem).</p>
  
  <p>I have tried to add <code>query-param</code></p>
  
  <pre><code>&lt;http:request-builder &gt;
      &lt;http:query-param paramName="json" value="#[payload]" /&gt;
  &lt;/http:request-builder&gt;
  </code></pre>
  
  <p>or use <code>message-properties-transformer</code></p>
  
  <pre><code>&lt;message-properties-transformer doc:name="Message Properties"&gt;
      &lt;add-message-property key="json" value="#[payload]"/&gt;
  &lt;/message-properties-transformer&gt;
  </code></pre>
  
  <p>but the result is still the same.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The HTTP configuration look like this</p>
  
  <pre><code>&lt;http:request-config name="request-HTTP" 
                       host="192.168.0.100" 
                       port="80"
                       doc:name="HTTP Request Configuration" /&gt;
  </code></pre>
  
  <p>Also tried to set <code>Content-Type</code> with </p>
  
  <pre><code>&lt;set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" doc:name="Property"/&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;http:request-builder&gt;
      &lt;http:query-param paramName="json" value="#[payload]"/&gt;
      &lt;http:header headerName="Content-Type" value="application/x-www-form-urlencoded"/&gt;
  &lt;/http:request-builder&gt;
  </code></pre>
  
  <p>However the body I'm receiving is still just <code>payload</code>, without other properties for example <code>json=</code> or <code>Content-Disposition: form-data; name="json"</code></p>