Using 'querystring.parse' built-in module's method in Node.JS to read/parse parameters

混江龙づ霸主 提交于 2019-12-06 13:55:50
  1. I think you need req.url rather than req._url.
  2. req.url is a string, if you want a URI instance use require('url').parse(req.url)
  3. So, you should finally have:

    var ParamsWithValue = querystring.parse(require('url').parse(req.url).query);

Edit: I corrected a typo in point 1, the last req.url -> req._url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!