【发布时间】:2016-04-11 18:50:14
【问题描述】:
在角度方面,我使用 post 方法传递了数据。
var data = {
'id': mydata.google_id,
'token': mydata.token,
'email': mydata.email,
'name': mydata.name
};
$http.post('http://localhost:3000/login1',data,config)
.success(function (data, status, headers, config) { ... })
.error(function (data, status, header, config) { ... });
在服务器端尝试访问我使用req.body.id 发布的数据,但我不能
当我在控制台中显示req.body 时,我得到了以下响应:
{ ' {"id" : "1234" , "email" : "xyz@gmail.com" , "name" : "xyz"}' : ' ' [_proto_] : { } }
帮我解决这个错误
【问题讨论】:
标签: angularjs node.js express google-api-nodejs-client