query static method

Router query(
  1. String path,
  2. Function action
)

A QUERY route (RFC 10008): a safe, idempotent read like GET, with the query in the request content instead of the URL — so it is not limited in length, and is less often written to logs on the way.

The request must say what its content is with Content-Type; one that does not, or whose content does not parse as that type, is answered with a 400. Content the framework does not parse into fields, such as application/sql, is in Request.rawBody.

Implementation

static Router query(String path, Function action) =>
    _addRoute(HttpRequestMethod.query, path, action);