fetchResource method

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

Fetches the resource identified by type and id.

Optional arguments:

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

Implementation

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