title: Mule ESB - How to create a HTTP request with POST method (sending parameters along)
body: <p>Short: I want to post a couple of parameters (like user=admin, key=12345678) using the POST method to a PHP page (like localhost/post-debug.php). The script would read the $_POST values and do whatever.</p>
  
  <p>My questions are:</p>
  
  <p><strong>1. How can I get the example below to work?</strong></p>
  
  <p><strong>2. How can I create the Map Payload with POST parameters from a JSON encoded payload and send it to the PHP script?</strong></p>
  
  <p>Below is an isolated case I am trying to get running (the parameters are "read" from the HTTP endpoint). I am calling directly from the browser the following URL:</p>
  
  <p><code>http://localhost:8081/httpPost?user=admin&amp;key=12345678</code></p>
  
  <p><img src="https://i.stack.imgur.com/QSGxz.png" alt="MULE Flow"></p>
  
  <p>The underlying XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
  http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
  http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd "&gt;
      &lt;flow name="httpPostTestFlow1" doc:name="httpPostTestFlow1"&gt;
          &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="httpPost" doc:name="HTTP"/&gt;
              &lt;http:body-to-parameter-map-transformer doc:name="Body to Parameter Map"/&gt;
  
          &lt;echo-component doc:name="Echo"/&gt;
          &lt;http:outbound-endpoint exchange-pattern="request-response" host="localhost/post-debug.php" port="80"  contentType="application/x-www-form-urlencoded" doc:name="HTTP" /&gt;
      &lt;/flow&gt;
  &lt;/mule&gt;
  </code></pre>
  
  <p>I am using MuleStudio 1.3.2, Mule ESB v.3.3.</p>
  
  <p>I've reviewed many similar questions but none got me on the right track.</p>