acceptQuery method

Router acceptQuery(
  1. List<String> mediaTypes
)

The media types this QUERY route takes, such as application/json; type/* and */* match a family or anything. A request with another type is answered with a 415, and the list is advertised in the Accept-Query header.

Implementation

Router acceptQuery(List<String> mediaTypes) {
  final accepted = [for (final type in mediaTypes) type.trim().toLowerCase()];
  for (final route in _lastAdded) {
    route.acceptQuery = accepted;
  }
  return this;
}