streamGet method
Send a GET request. The response will be streamed, meaning the body will be available asynchronously. This is useful for large response bodies or for proxies.
If uri
is given, the request will be sent to that exact uri. If uri
is
null, the uri on the BaseRequest will be used (and is thus required).
If headers
are given, they will be merged with the set of headers
already defined on the BaseRequest.
Implementation
@override
Future<StreamedResponse> streamGet(
{Map<String, String>? headers, Uri? uri}) async {
final response =
await _send('GET', headers: headers, streamResponse: true, uri: uri);
assert(response is StreamedResponse,
'streamGet() should return a StreamedResponse');
return response as StreamedResponse;
}