You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A query string is not given back as a plain string but rather urlencoded. All the special characters are still escaped, ex. Visit /people?location=London, ON in the browser, and the ' ' is escaped to '%20', Then when accessing it with req.query['location'] you get 'London,%20ON' when you really want 'London, ON'.
The string needs to be url decoded before going into the query dict.
As a sidenote, please consider making req.query and object instead of a dict, sort of the same way req.body should be.
The text was updated successfully, but these errors were encountered:
A query string is not given back as a plain string but rather urlencoded. All the special characters are still escaped, ex. Visit
/people?location=London, ON
in the browser, and the' '
is escaped to'%20'
, Then when accessing it withreq.query['location']
you get'London,%20ON'
when you really want'London, ON'
.The string needs to be url decoded before going into the query dict.
As a sidenote, please consider making
req.query
and object instead of a dict, sort of the same wayreq.body
should be.The text was updated successfully, but these errors were encountered: