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