downloadBytes method

Future<PlexApiResult> downloadBytes(
  1. String endpoint, {
  2. Map<String, dynamic>? queryParams,
  3. Map<String, String>? headers,
})

Downloads binary content from the specified URL into memory.

endpoint - The API endpoint or full URL queryParams - Optional query parameters to append to the URL headers - Optional headers to include in the request

Returns a Future<PlexApiResult> with PlexApiResult.data as Uint8List on success

Implementation

Future<PlexApiResult> downloadBytes(
  String endpoint, {
  Map<String, dynamic>? queryParams,
  Map<String, String>? headers,
}) async {
  final response = await PlexNetworking.instance.downloadBytes(
    endpoint,
    query: queryParams,
    headers: headers,
  );

  return _handleResponse(response);
}