/// <summary>
        ///
        /// </summary>
        /// <param name="url">要请求的 URL</param>
        /// <param name="dataType">要请求的 MIME 类型</param>
        public HttpUtil(string url, Contype dataType)
        {
            this.url      = url;
            this.dataType = dataType;

            ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="url">要请求的 URL</param>
 /// <param name="dataType">要请求的 MIME 类型</param>
 public HttpUtil(string url, Contype dataType)
 {
     this.url      = url;
     this.dataType = dataType;
 }