Node.js 节点JS请求模块不发送表单数据

Node.js 节点JS请求模块不发送表单数据,node.js,express,post,request,Node.js,Express,Post,Request,我使用node js中的“request”模块发出post请求,如下所示: 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; }); 不,在服务器端我得到了请求,但是参数没有出现。我做错了

我使用node js中的“request”模块发出post请求,如下所示:

 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;
});

不,在服务器端我得到了请求,但是参数没有出现。我做错了什么?

我认为您必须对表单数据进行字符串化并将其放入正文中。这里有一个已经回答过的类似问题:

您在网络选项卡中得到了什么?我不是通过浏览器来完成的