Scenario: We developer are trying to replace a web service (written in C#.Net) with Node.JS Restful API.
Issue: Now we need to hand
Simon's answer is no longer valid as restify's queryParser has been moved to the restify-plugins package. The updated solution is
server.use(require('restify-plugins').queryParser());
You just need to load the query parser plugin like so;
server.use(restify.plugins.queryParser());
Restify 5 (2017) answer:
As of restify 5 you can now setup the query parser like this:
server.use(restify.plugins.queryParser());
.
If you use this plugin you can access the parsed params in req.query
.
For additional options and information, take a look into the restify documentation: http://restify.com/docs/plugins-api/#queryparser