【发布时间】:2017-07-05 06:15:04
【问题描述】:
我想将数据发送到在 tomcat 服务器上运行的 java 后端。这是我迄今为止尝试过的。我已经安装了请求模块。get 方法工作正常。
Router.post('/', function(req, res) {
request({
uri: "http://localhost:8080/HIS_API/rest/UserService/registerUser",
method: "POST",
form: {
roleId:2,
employeeId:26,
userName:"testing",
password:"123"
}
}, function(error, response, body) {
console.log(body);
});
});
【问题讨论】:
-
那么究竟是什么不起作用?你有错误吗?服务器是否期望除了
application/x-www-form-urlencoded之外的东西?