fetchCollection method
Fetches the primary collection of type type
.
Optional arguments:
headers
- any extra HTTP headersquery
- a collection of parameters to be included in the URI query
Implementation
Future<CollectionFetched> fetchCollection(
String type, {
Map<String, List<String>> headers = const {},
Iterable<QueryEncodable> query = const [],
}) async {
final response = await send(
_baseUri.collection(type),
Request.get()
..headers.addAll(headers)
..query.mergeAll(query));
return CollectionFetched(
response.httpResponse, response.document ?? (throw FormatException()));
}