我需要从WEB API方法调用HTTPS POST服务。 我正在使用HttpWebRequest来调用此API,但是由于 “由于连接方在一段时间后未正确响应而导致连接尝试失败,或者由于连接的主机未能响应x.x.x.x:443而建立的连接失败”
当我尝试在Windows Form中调用此API时,效果很好。
array(67) {
["cost_service_1"]=>
array(1) {
[0]=>
string(4) "2500"
}
["cost_service_2"]=>
array(1) {
[0]=>
string(4) "3200"
}
["cost_service_3"]=>
array(1) {
[0]=>
string(4) "2000"
}
["cost_service_4"]=>
array(1) {
[0]=>
string(4) "1800"
}
}
答案 0 :(得分:0)
可能是因为您从最后一部分开始尝试使用SSL-x.x.x.x:443。我的理解是443用于SSL。很高兴有人纠正我。
看看以下内容,这可能对您有帮助:
https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/working-with-ssl-in-web-api