I used to parse post request body with express.js, but now it started to give undefined when i try to log req.body.gsm
. {"gsm":"10"}
this is my post data, and I make the request with a rest client.
app.configure(function(){
app.use(express.bodyParser());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
app.post('/gsm', function (req, res) {
var gsm = req.body.gsm; //gsm is undefined when i log
var body = req.body; //this is the log of body { '{\n"gsm":"10"\n}': '' }
});