fetchRelatedCollection method

Future<CollectionFetched> fetchRelatedCollection(
  1. String type,
  2. String id,
  3. String relationship, {
  4. Map<String, List<String>> headers = const {},
  5. Iterable<QueryEncodable> query = const [],
})

Fetches the related resource collection identified by type, id, relationship.

Optional arguments:

  • headers - any extra HTTP headers
  • query - a collection of parameters to be included in the URI query

Implementation

Future<CollectionFetched> fetchRelatedCollection(
  String type,
  String id,
  String relationship, {
  Map<String, List<String>> headers = const {},
  Iterable<QueryEncodable> query = const [],
}) async =>
    CollectionFetched(await send(
        _baseUri.related(type, id, relationship),
        Request.get()
          ..headers.addAll(headers)
          ..query.mergeAll(query)));