我已将我的API部署在服务器中,并且可以通过HTTP,https请求之一来访问API。 我已经通过发出http请求测试了api。喜欢
String loginURL="https://<ip>/login/auth";
http.Response response = await http.post(loginURL,
headers: {"Content-type": "application/json"},
body: json.encode({"username": username, "password": password}));
如果我完成了http请求,我将获得成功代码为200的响应
但是当我尝试使用与https一起部署的相同API时。我在服务器未收到任何响应的情况下得到异常。如何发出https请求?