2

I am making a post request using "request" module in node js like this:

 request.post({url: 'http://localhost:4004/api/v1/notifications/post', form: {msg:msg, userID:userID}}, function(err, httpResponse, body){
    if(err) return 0;
    else return 1;
});

no the server side I get the request, however the parameters do not come. What am I doing wrong?

1 Answers1

2

I think you have to stringify your form data and put it in the body. Here is a similar question that has been answered: POST Requests not working using request module in node.js

hhoburg
  • 373
  • 2
  • 10