getRaw method

Future<List<int>> getRaw(
  1. String endpoint
)

Make a GET request and return raw bytes

Implementation

Future<List<int>> getRaw(String endpoint) async {
  try {
    final response = await dio.get(
      endpoint,
      options: Options(responseType: ResponseType.bytes),
    );
    return response.data as List<int>;
  } on DioException catch (e) {
    logger.severe('HTTP raw request failed: ${e.message}');
    rethrow;
  }
}