meltwater / served

A C++11 RESTful web server library
MIT License
710 stars 174 forks source link

Improved query string parsing and param access #1

Closed Jeffail closed 9 years ago

Jeffail commented 9 years ago

The query string of request URLs will now automatically be parsed for all requests and stored in req.query as key/value pairs after being URL unescaped.

The query string of request URLs is now automatically parsed as key/value pairs. These values are URL unescaped and stored in req.query.

The req.query object is the same served::parameters type as req.params, and this type has been improved with the ability to iterate. Iterating all REST params is now as simple as:

for ( auto p : req.params ) {}

And, similarly, for query string key/value pairs:

for ( auto q : req.query ) {}