0
votes

I am mapping an inbound HTTP POST request to an outbound GET using Mule 3.4.

The POST body is JSON and I want to take the fields from the JSON content and map them to query string parameters. Currently I simply transform the JSON to a map and have an expression in my path of the outbound http endpoint:

<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test?tax=#[payload.taxonomy]" method="GET" doc:name="HTTP"/>

This is fine but I wondered if there is smarter way. Ideally I was hoping for something like setting an outbound property to the value of the map and Mule automatically converting whatever key-value pairs were in there into query params for the outbound request.

1

1 Answers

0
votes

There's no such support but you can write a simple MEL expression to generate a flow variable that contains all the key/value pairs.

See:

to learn more about MVEL, the underlying language of MEL.