Call REST (POST) error

0
Hi everyone.  I am pretty new in Mendix so please be patient lol. I am trying to create a Mendix microflow that takes in input two integers, send them via API to a python flask app, and print the sum of those.   I already did this with GET w no problem. I was now trying to approach the same problem w POST method but I got stucked.   I am following the suggestions reported on this post https://community.mendix.com/link/space/app-development/questions/101279. The first problem is tackled correctly (escape ONLY the opening braces to a double brace in the Request template). The second one ( Under Request headers, add a header with Key set to Content-Type and Value set to application/json. ) continues to give me the error: "the '/'part is incomplete or incorrect. you could use here: parenthesis".   Any suggestions?
asked
1 answers
0

Hi Marco,

 

When I build JSON for a request, I prefer to use an Export Mapping which will place the JSON in a string variable that is then available to be placed in the request body. This will save you from the need to escape brackets.

 

Looks like your header value is not wrapped in single quotes.  The value can be a constant, variable or string however the string needs to be wrapped in single quotes. For example:

 

'application/json'

 

Hope this helps,

Sam

answered