getJsonListBody method
Returns the response body as json list.
If the response body data cannot be converted to string, this will throw an ApiException.
Since body data is streamed, it can only be received once. A call to one of the following methods / getters will drain the body stream:
Also throwOnError will drain the stream to parse error data in the case of a non-success status code.
Implementation
Future<List<dynamic>> getJsonListBody() async {
try {
return await charset.decodeStream(bodyData).then(jsonDecode)
as List<dynamic>;
} catch (e) {
throw ApiException('Cannot convert body data to json map.', e);
}
}