HttpClient httpClient = new HttpClient();
httpClient.connectionTimeout = Duration(seconds: 180);
HttpClientRequest request = await httpClient.postUrl(Uri.parse(url));
request.headers.set('content-type', 'application/json');
request.add(utf8.encode(json.encode(params)));
HttpClientResponse response = await request.close().timeout(const Duration(seconds: 180));
httpClient.close();
String chargeSessionEndPoint;
if (response.statusCode == 200) {
//Handling Response
}
从我的服务器获取响应有一个延迟(大约3分钟)。由于我将超时时间设置为3分钟,但仍然超时时间为1分钟。
能帮我一下吗?
使用的http软件包。