Is there a difference between obtaining QUERY_STRING arguments via req.query[myParam] and req.params.myParam? If so, when should I use which?
Is there a difference between obtaining QUERY_STRING arguments via req.query[myParam] and req.params.myParam ? If
Share
req.paramscontains route parameters (in the path portion of the URL), andreq.querycontains the URL query parameters (after the?in the URL).You can also use
req.param(name)to look up a parameter in both places (as well asreq.body), but this method is now deprecated.