Future<List<int>> readBytesFromResponse(HttpClientResponse response)

Reads the entire response as a list of bytes.

Source

static Future<List<int>> readBytesFromResponse(HttpClientResponse response) async {
  return await response.fold([], (a, b) {
    a.addAll(b);
    return a;
  });
}