首页 > express如何接受angular 使用$http.post来的数据

express如何接受angular 使用$http.post来的数据

我用angular post了一个对象去node服务端 类似:

var obj = {};
obj.title = "title";
obj.data = {expire:new Date(), detail:{data:[1,2,3]}}
$http.post('host', {obj:obj})
.success(function(suc){
//success callback
})

node用的express3.x, req.body的数据看起来是被toString()过的, 嵌套的对象被解析成了空字符串, 不知如何是好?


使用浏览器控制台
如chrome控制台查看发送过去的数据是什么样的
是否被正确的转成了JSON格式的字符串

【热门文章】
【热门文章】