http post 请求数据时提示 基础连接已关闭 发送时发生错误

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;

 

在WebRequest 请求之前加上以上两句即可

posted @ 2021-01-07 14:36  v587yy  阅读(537)  评论(0编辑  收藏  举报