You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this still a problem? I find it hard to believe that it is. If so, can anyone provide minimal, complete code that can reproduce the problem? A runtime error doesn't make sense since the above code would fail static checks (List<int> does not have a lengthInBytes member.)
Anyway, I tried doing:
import'dart:typed_data';
import'package:http/http.dart'as http;
voidmain() async {
var client = http.Client();
var request = http.Request('GET', Uri.parse('https://www.google.com/'));
var response =await client.send(request);
awaitfor (var chunk in response.stream) {
if (chunk isUint8List) {
print('chunk is Uint8List'); // This gets printed.
}
}
client.close();
}
and although the static type of chunk is a List<int>, its actual runtime type is a Uint8List.
I was surprised when streaming in a response, the chunks were
List<int>
, notUint8List
The text was updated successfully, but these errors were encountered: