How to pass query string to a post request using mulesoft
<p>I am new to Mulesoft and am trying to send some (four) query parameters. When testing using SOAP UI
<a href="https://i.stack.imgur.com/M0zHc.png" rel="nofollow noreferrer">A screen shot of what I tested</a></p>

<p>I replicated this in mulesoft using the following xml configuration</p>

<pre><code>&lt;flow name="boxintegrationFlow1"&gt;
    &lt;http:listener config-ref="HTTP_Listener_Configuration1" path="*" doc:name="HTTP"/&gt;
    &lt;logger message="Message: #[message.inboundProperties] Code: #[message.inboundProperties.'http.query.params'.code]" level="INFO" doc:name="Logger"/&gt;
    &lt;set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" doc:name="Property"/&gt;
    &lt;set-variable variableName="QueryParameters" value="{'grant_type':'authorization_code', 'code':''#[message.inboundProperties.'http.query.params'.code]','client_id':'abc','client_secret':'xyz'}" doc:name="Variable" mimeType="application/x-www-form-urlencoded"/&gt;
    &lt;logger message="#[flowVars.QueryParameters]" level="INFO" doc:name="Logger"/&gt;
    &lt;set-payload value="#[flowVars.QueryParameters]" doc:name="PostQueryParameters"/&gt;
    &lt;http:request config-ref="getToken" path="/oauth2/token" method="POST" sendBodyMode="ALWAYS" doc:name="HTTP"&gt;
        &lt;http:request-builder&gt;
            &lt;http:query-param paramName="grant_type" value="authorization_code"/&gt;
            &lt;http:query-param paramName="code" value="#[message.inboundProperties.'http.query.params'.code]"/&gt;
            &lt;http:query-param paramName="client_id" value="xyz"/&gt;
            &lt;http:query-param paramName="client_secret" value="abc"/&gt;
        &lt;/http:request-builder&gt;
        &lt;http:success-status-code-validator values="400"/&gt;
    &lt;/http:request&gt;
    &lt;logger message="Message: #[message.outboundProperties] " level="INFO" doc:name="Logger"/&gt;
&lt;/flow&gt;
</code></pre>

<p>On doing this am getting an error "{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}"</p>

<p>I understand that we have pass it as a query string, but am not able to figure out how do I do it. </p>

<p>Any pointers are appreciated. Thank you in advance!</p>