是我的帖子:
account_id 1231
limit 3
ordertype limit
quantity 1
symbol USDJPY
transaction_type buy
在我的代码中,我有:
var account_id = req.param('account_id', null);
var symbol_pair = req.param('symbol', null);
var transaction_type = req.param('transaction_type', null);
var order_type = req.param('ordertype', null);
var amount = req.param('amount', null);
var limit = req.param('limit', null);
console.log(account_id + " | " + symbol_pair + " | " + transaction_type + " | " + order_type + " | " + amount + " | " + limit);return;
但出于某种原因,ordertype
会回来market
。有什么想法正在发生什么?
答案 0 :(得分:3)
确保您拥有app.use(express.bodyParser());
并尝试使用req.body.account_id
(并为每个人尝试类似的风格)
答案 1 :(得分:0)
您正在定义order_type,然后尝试使用ordertype将其恢复。别忘了你的下划线!