flutter/lib/ui/ui_dart_state.cc(186)] 未处理的异常:SocketException:操作系统错误:连接被拒绝,errno = 111,地址 = 服务器 ip,端口 = 33450
我有带有 flutter 的应用程序。我必须连接到服务器我的IP就像= https://91.#.#.#:5000/api 当我将数据发布到服务器时,我得到 flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Connection returned, errno =111,address =server ip, port = 33450 我的代码 var url = Uri.parse(AddressController.text); http.Response 响应=等待http.post(url, body: {});
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: {});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SocketException 通常在您没有互联网时发生,请让用户知道您有互联网,如果您在真实设备中进行测试,请确保在清单中添加互联网权限
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