本文共 554 字,大约阅读时间需要 1 分钟。
if
(url.StartsWith(
"https"
, StringComparison.OrdinalIgnoreCase))
///https请求
ServicePointManager.Expect100Continue =
true
;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
ServicePointManager.ServerCertificateValidationCallback =
new
RemoteCertificateValidationCallback(CheckValidationResult);
webRequest = WebRequest.Create(url)
as
HttpWebRequest;
webRequest.ProtocolVersion = HttpVersion.Version10;
webRequest = WebRequest.Create(url)
as
HttpWebRequest;
转载于:https://www.cnblogs.com/only-yu/p/7101102.html