Mule Server 3.6 > Anypoint Studio > Request Connector

186 views Asked by At

How do I set the Request Connector to send Raw JSON data using POST method?

On my Set Payload transformer I have this:

#[{ "productId": #[sessionVars.productId] }]

When I run my Mule App, I get the following error:

Error sending HTTP request. Message payload is of type: String

What am I missing?

1

There are 1 answers

0
Sudarshan On BEST ANSWER

You could try adding

 <set-variable variableName="Content-Type" value="application/json" />

just above your http request endpoint.

For more details have a look here

Let me know if this works for you.