fetchStream function

Future<Content> fetchStream(
  1. Uri url, {
  2. Map<String, String>? headers,
})

Fetch content as a stream from a HTTP(S) resource identified by url.

Throws an ApiException if fetching fails. Also response status codes other than codes for success are thrown as exceptions.

Implementation

Future<Content> fetchStream(Uri url, {Map<String, String>? headers}) =>
    headers != null
        ? HttpFetcher.simple().headers(headers).fetchStream(url)
        : HttpFetcher.simple().fetchStream(url);