提交代码
This commit is contained in:
@@ -19,6 +19,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static string Http(string url, string method = "GET", string contenttype = "application/json;charset=utf-8", Hashtable header = null, string data = null)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 |
|
||||
SecurityProtocolType.Tls | SecurityProtocolType.Tls11 |
|
||||
SecurityProtocolType.Tls12;
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||
@@ -96,7 +99,7 @@ namespace BLL
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||
if (header != null)
|
||||
{
|
||||
foreach (var i in header.Keys)
|
||||
|
||||
Reference in New Issue
Block a user