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.
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, ONin 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.queryand object instead of a dict, sort of the same wayreq.bodyshould be.