I'm new in MULE ESB, I have this code and i'm trying sending a http request using http:request with the following format:
"http: //www.host.com/api/commentThreads?key=val&part=val2&..."
<file:inbound-endpoint connector-ref="fileConnector" path="C:/tmp/input"
doc:name="Reader File Configuration" responseTimeout="10000"
encoding="UTF-8" mimeType="text/plain"
pollingFrequency="20000">
<file:filename-wildcard-filter pattern="*.json"/>
</file:inbound-endpoint>
<json:json-to-object-transformer returnClass="java.util.Map" doc:name="JSON to Object"/>
<logger level="INFO" message="#[payload]" doc:name="Logger" />
<http:request config-ref="HTTP_Request_Configuration" path="/commentThreads" method="GET" port="443" doc:name="HTTP Request">
<http:request-builder>
<http:query-param paramName="key" value="#[message.payload.key]"/>
<http:query-param paramName="allThreadsRelatedToChannelId" value="#[message.payload.allThreadsRelatedToChannelId]"/>
<http:query-param paramName="part" value="#[message.payload.part]"/>
</http:request-builder>
</http:request>
But I'm having this error:
- Message : Error sendinbut g HTTP request. Message payload is of type: LinkedHashMap
- Code : MULE_ERROR--2
Exception stack is:
- null (java.util.concurrent.TimeoutException) org.glassfish.grizzly.impl.SafeFutureImpl$Sync:357 (null)
- Error sending HTTP request. Message payload is of type: LinkedHashMap (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
The question is how can I do to make a http request with that format using the map?
According to documents
The Mule Message payload is converted into a byte array and sent as the HTTP Request's body. This behavior is carried out always, except in the following scenarios:
The Mule Message's Payload is a Map of keys and values
Generate the Request Body with Content-Type:application/x-form-urlencoded
Whenever the message payload is a Map, the connector automatically generates an HTTP request with the header Content-Type:application/x-www-form-urlencoded. The keys and values of the map in the payload are converted into form parameter keys and values in the body of the HTTP request.
I suppose the map is converter automatically for the request. Correct me if I'm wrong