Serialise JSON in REST call using the Call Rest action

1
Is there a way to see the JSON being submitted while using the Rest action within Mendix 7   I am trying to submit the following JSON string via post { "key": "sfdsdfsdfsdfds" } Within the action I interpret it as  where index 1 is the $Key string value. "key":"{1}"   The response i get, however is:  {"status":"error","code":-1,"name":"ValidationError","message":"You must specify a key value"} Debug shows the $Key variable is populated correctly.    I would like to see the actual JSON being submitted so that I can see what the exact problem is. 
asked
3 answers
1

You can use set your loglevel (REST Consume or REST Publish) to trace and see the actual JSON POST request.

answered
0

If you add double braces, as Allard suggested, you can get the format you want:

Rest call action:

{{
 "key" : {1} 
}

result via trace log:

{
 "key" : yourkeyhere
}

 

answered
0

If I put all REST nodes onto trace then I see the JSON payload as the following:

Request content for POST request to https://url/ping.json HTTP/1.1

"key":"sfdsdfsdfsdfds"

It looks like it drops the braces? If I add the braces back in then I get a modeller error "Brace should be followed by a number of digits or another brace"

This error makes me think that I'm using the Custom request teamplte on the CallRest action incorrectly. 

 

 

answered