getJsonListBody method

Future<List> getJsonListBody()

Returns a List representation of json body data.

Useful for small size bodies. For large amounts of data use bodyData stream instead.

Implementation

Future<List> getJsonListBody() async {
  try {
    return JsonDecoder().convert(await getTextBody()) as List;
  } catch (_) {
    throw ApiRequestException.badRequest('Invalid body data.');
  }
}