Ajax request on local network

Hi community I’m trying to get data from an API on local network
I’m trying to reach my API by the IP Address

 Uri url = Uri.https('192.168.1.12:8088', 'home/test');
          var response = await http.get(url);
          if (response.statusCode == 200) {
            var jsonResponse = convert.jsonDecode(response.body);

            print('Number of books about http: $jsonResponse.');
          }

and I get this error :
E/flutter (25230): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
E/flutter (25230): WRONG_VERSION_NUMBER(tls_record.cc:242))

All thanks

Hello and welcome,
it seems your HTTPS client is hitting an HTTP endpoint; check you have a proper TLS server or change your client to use Uri.http instead of Uri.https.

1 Like