'How to get the body of post request in WSO2 prototype with inline script?

I want to create some APIs prototypes in WSO2 (v4.0.0) with post requests using inline script. I can get and print values passed in the URI or in the query, but I can't get params from the post body. I would appreciate your help

Example of how to get a value from the uri.

url: /stuff/{x}
mc.setProperty('CONTENT_TYPE', 'application/json');
var x = mc.getProperty('uri.var.x');
mc.setPayloadJSON('{ "data" : "'+ x +'"  }');


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source