query property

QueryParams query

Returns query parameters of the request

Lazily creates query parameters to enhance performance of route handling.

Example:

server.get('/api/quote', (ctx) {
  final int index = ctx.query.getInt('index', 1); // The magic!
  return quotes[index + 1];
});

Implementation

QueryParams get query {
  if (_query != null) return _query;

  _query = new QueryParams(req.uri.queryParameters);
  return _query;
}