requestAsStream method
Implementation
Stream<Either> requestAsStream(
Method method,
String route, {
Map<String, String> params = const {},
}) async* {
Uri uri = _buildUri(route, params);
http.Response? response;
try {
await _makeRequest(method, uri);
if (_response.statusCode == 200) {
yield Right(response);
}
} catch (e) {
yield Left(
Failure(
_response.statusCode,
e.toString(),
),
);
}
}