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
})
);
我尝试将<uses-permission android:name="android.permission.INTERNET"/>
添加到清单中并更改模拟器上的代理。谢谢
答案 0 :(得分:0)
127.0.0.1
是本地主机环回地址。您需要使用机器的实际 IP 地址来建立连接。