基础连接已经关闭: 发送时发生错误

在 WebRequest.Create前面加上以下内容,注释的可以不加。

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
//ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
//ServicePointManager.CheckCertificateRevocationList = false;
//ServicePointManager.DefaultConnectionLimit = 512;
//ServicePointManager.Expect100Continue = false;
var htpRequest = (HttpWebRequest)WebRequest.Create(input_url);

 

你可能感兴趣的:(基础连接已经关闭: 发送时发生错误)