'Read CONTINUATION frame with Flutter
I have a sensor which sends data in a continuous stream in CONTINUATION frames within a http communication. As example a Wireshark protocol using a Firefox browser is here: https://i.stack.imgur.com/GD047.png. `` When I use the Flutter package http e.g.:
_client = http.Client();
Uri uri = Uri.parse('http://192.168.178.84:1456');
var request = http.Request(
"GET",
uri,
);
Future<http.StreamedResponse> response = _client.send(request);
try {
response.asStream().listen((streamedResponse) {
streamedResponse.stream.listen((data) {
var result = asciiDecoder.convert(data);
print(result);
});
});
} catch (e) {
print("Caught $e");}
I get '[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid response line' as soon as the sensor sends the first 'continuation' frame. As I am not familiar with http, can anybody help me reading 'continuation' frames?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
