fetch function
Fetch (read fully) content body 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> fetch(Uri url, {Map<String, String>? headers}) =>
headers != null
? HttpFetcher.simple().headers(headers).fetch(url)
: HttpFetcher.simple().fetch(url);