I have app with flutter . I have to connect to server my ip is like =https://91.#.#.#:5000/api when i post data to server i get flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Connection refused, errno =111,address =server ip, port = 33450 my code var url = Uri.parse(AddressController.text); http.Response response = await http.post(url, body: {});
1 Answer
SocketException usually occurs when you don't have internet please make user that you have internet, if you're testing in real device make sure you put internet permission in manifest
3 Comments
reyhane
internet permission is in mainfest and I have flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Connection refused, errno =111,address =server ip, port = 33450 my code var url = Uri.parse(AddressController.text); http.Response response = await http.post(url, body: {});
ahmed mohamed abdulkadir
can you use URL instead of IP Address
reyhane
no. i should to use ip address