简体   繁体   English

未处理的异常:SocketException:操作系统错误:连接被拒绝,errno = 111,地址 = 127.0.0.1,端口 = 40712

[英]Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 40712

Future<User> registerUser(String username, String firstname, String lastname, String password, String email) 
      async {
        print("\n\n\n\n\n\n\nHello\n\n\n\n\n\n\n\n");
        final response = await client
            .post('http://127.0.0.1:5000/api/register', // the error exists here
            // headers: "", 
            body: jsonEncode({
              "emailaddress": email,
              "username": username,
              "password": password,
              "first_name": firstname,
              "last_name": lastname
            })
          );

I've tried adding <uses-permission android:name="android.permission.INTERNET"/> to my manifest and changing the proxy on my emulator.我尝试将<uses-permission android:name="android.permission.INTERNET"/>到我的清单并更改我的模拟器上的代理。 Thanks谢谢

127.0.0.1 is a localhost loopback address. 127.0.0.1是本地主机环回地址。 You'd need to use your machine's actual IP address to establish the connection.您需要使用机器的实际 IP 地址来建立连接。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SocketException:连接被拒绝(操作系统错误:连接被拒绝,errno = 111),地址 = localhost,端口 = 44382 - SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = localhost, port = 44382 未处理的异常:SocketException:连接超时(操作系统错误:连接超时,errno = 110)。为什么我会收到此错误? - Unhandled Exception: SocketException: Connection timed out (OS Error: Connection timed out, errno = 110).Why am I getting this error? E/flutter (8084): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] 未处理的异常:SocketException:操作系统错误:连接被拒绝 - E/flutter ( 8084): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: SocketException: OS Error: Connection refused urlopen 错误 [errno 111] 连接被拒绝 - urlopen error [errno 111] connection refused 模拟器:连接至套接字“ 127.0.0.1:1970”时出错:111-&gt;连接被拒绝 - emulator: Error while connecting to socket '127.0.0.1:1970': 111 -> Connection refused Flutter SocketException:操作系统错误:没有到主机的路由,errno = 113,地址 = xxxx,端口 = 42376 - Flutter SocketException: OS Error: No route to host, errno = 113, address = xxxx, port = 42376 Errno111 连接被拒绝 Kivy 套接字错误 - Errno111 Connection Refused Kivy Socket Error AndroidViewClient中的Culebra返回“ RuntimeError:错误:连接到 - Culebra in AndroidViewClient returns "RuntimeError: ERROR: Connecting to <socket… [Errno 111] Connection refused ubuntu:所有android模拟器(x86和arm)卡在“连接到套接字时出错&#39;127.0.0.1:1970&#39;:111 - &gt;连接被拒绝” - ubuntu: all android emulator(x86 and arm) stuck on “Error while connecting to socket '127.0.0.1:1970': 111 -> Connection refused” 如何解决 SocketException: Failed host lookup: &#39;www.xyz.com&#39; (OS Error: No address associated with hostname, errno = 7) - How to solve SocketException: Failed host lookup: 'www.xyz.com' (OS Error: No address associated with hostname, errno = 7)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM