我正在尝试将数据从flutter发布到node API。我的代码如下。
final String uri = "http://localhost:3000";
Map<String, String> userBody = {
"firstName":"Vishal",
"lastName":"Soni",
"email":"vishal@gmail.com",
"mobile":"1234567890",
"password":"123",
};
Future<dynamic> postData() async {
try {
http.Response res = await http.Client().post("$uri/register", body: jsonEncode(userBody), headers: {
'Content-Type': 'application/json',
});
print(res);
} catch (e) {
print(e);
}
}获取以下错误

发布于 2020-10-20 19:39:03
发布于 2020-10-21 17:44:21
在终端中运行以下命令
adb reverse tcp:3000 tcp:3000 https://stackoverflow.com/questions/64444236
复制相似问题