getURLAsByteArray function

FutureOr<List<int>?> getURLAsByteArray(
  1. String url, {
  2. HttpClient? client,
  3. String? method,
})

Implementation

FutureOr<List<int>?> getURLAsByteArray(
  String url, {
  HttpClient? client,
  String? method,
}) {
  var response = getURL(url, client: client, method: method);
  return response.then(
    (response) => response.body?.asByteArrayAsync,
    onError: (e) => null,
  );
}