在尝试使用位于服务器上的REST api时遇到一个奇怪的问题。 第一个和第二个连接可以成功执行,但是,当我尝试使第三个连接挂起时! 仅当我尝试从任何移动设备(使用flutter或xamarin ....等的Android或iOS)连接时,才会出现此问题 并且仅在使用我的wifi网络时使用(当使用我的蜂窝数据时,效果很好!) 当我使用邮递员或任何网页上的ajax请求时,我没有任何问题。 这是我的终点,我希望有人可以帮助我找出并确定确切原因: https://camtend.com/api/v1/test_api1
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void login() {
ar url = "https://camtend.com/api/v1/test_api1";
var client = new http.Client();
client
.post(
url,
)
.then((response) {
print("Response status: ${response.statusCode}");
print("Response body: ${response.body}");
}).catchError((e) {
print('******* Error $e');
}).whenComplete(client.close);
}
谢谢。