The default setup for Restify places parsed parameters in req.params
. This is done by both the queryParser
and the different bodyParser
middlewares.
So to access the quantity
parameter, use req.params.quantity
.
If you really want to use req.body
instead, you need to pass mapParams : false
to the bodyParser
constructor:
app.use(restify.plugins.urlEncodedBodyParser({ mapParams : false }));
Now req.body
will contain the parsed parameters.