what we need to pass as a request when we are using Call Rest (POST) ?

0
  Hi all ,   what we need to pass as a request when we are using Call Rest (POST)   How we need to pass the request in call rest post ,which there is data as raw
asked
3 answers
1

you need to put exactly this : 

 

{“res”:{“comments”:”feedback”,”name”:”test”}}

 

if feedback and name are dynamic you need to replace them with {1} and {2}

answered
1

Hi Praneeth

The answer to your question is documented here https://docs.mendix.com/howto/integration/consume-a-rest-service and here https://docs.mendix.com/refguide/call-rest-action 

I’d advise you to work with either ‘Custom request template’ in the Request-tab of the action ‘Call REST (POST)’ or – which in my oppinion is prettier and more clear for future development – with an ‘Export mapping for the entire request’. Where you can create an Entity based upon your JSON-string.

More information on Import/Export mapping can be found here: https://docs.mendix.com/refguide/export-mappings

Hope this helps!

Kind regards,

Leander

 

answered
1
{{"res":{{"comments":{1},"name":{2}}}

Try that. You need to replace every { with {{, because it’s a string template (see https://docs.mendix.com/refguide/call-rest-action#string-template)

answered