call REST with POST method

0
hi team ,  i have to use call rest activity with post method  and below is my body = {                 "token": "string",                 "data": {                     "question": "string",                     "answer": "string"                 }             }   this is my microflow  and i want response in jSON
asked
2 answers
0

If you set the operation to POST, you can provide the body in the Request tab. Easiest way is to select "custom request template" and paste in your body example. You can use variables to add dynamic data.

 

In the next tab, Response, you can specify what you want to do with the result, for example saving the response in a string variable. This will allow you to show it on a page.

 

image.png

answered
0

You'd normally use an Export Mapping to convert your data into a JSON structure that you'd use in your Call REST action. You'd also use an Import Mapping to map the response back to Mendix entities.

 

There is a good worked example in the Mendix Academy that runs through exactly how to do this.

 

https://academy.mendix.com/link/modules/138/lectures/5198/Learning-Objectves

 

I hope this helps. Good luck!

answered