Start a new topic

body not sent when use request module with post


i'm experiencing issues with the following code in the BL:

function onPreSave(request, response, modules)


var req = modules.request;

var logger = modules.logger;;




uri: 'http://***/api/export',

method: 'POST',

body : "something" //.stringify(request.body)


function(error, res, body)


if (error)


response.body = {error: error.message};





response.body = JSON.parse(body);






i receive the call in my nodejs server, but when i check the request.body, it says it is undefined..

What am i doing wrong?

Thanks for the fast reply!

That was indeed the solution, thank you!
You probably need json:true (or Content-Type: application/json header, which is equivalent). Your node.js server does not know how to deserialize the body.
Login or Signup to post a comment