req.url不显示完整的url

我使用Restify,由于某种原因,req.url只显示第一个查询参数的URL。 req.query也只显示queryStartDate。

http://localhost:6001/myapp/v1/filter/path1/path2/v4.0/mhs/query/path3/path4/path5?queryStartDate=19000101&queryEndDate=21000101&requestSource=source&includeSources=1&excludeSources=2 

码:

 //Breakpoint in my first handler: HttpHandlers.prototype.readHttpRequest = function (req, res, next) { req.locals = {}; res.locals = {}; ... var httpHandlers = new HttpHandlers(); server.get('/hello/:name', httpHandlers.readHttpRequest ); 

原来,这是由于我用curl发送URL而不是用双引号括起来的。 Linux看到“&”并在后台运行上述命令,所以Node.js只能看到第一个“&”之前的所有内容。