My code looks like this:
HttpClient client = new HttpClient();
client.get('192.168.4.1', 80, '/').then((HttpClientRequest req) {
print(req.connectionInfo);
return req.close();
}).then((HttpClientResponse rsp) {
print(rsp);
});
I'm trying to make a HTTP-Get request in the local wifi-network, that has no internet-connection, but I always get the following Error:
E/flutter ( 8386): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception: E/flutter ( 8386): SocketException: Connection failed (OS Error: Network is unreachable, errno = 101), address = 192.168.4.1, port = 80 E/flutter ( 8386): #0 _rootHandleUncaughtError. (dart:async/zone.dart:1112:29) E/flutter ( 8386): #1 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) E/flutter ( 8386): #2 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
I'm using an android device.