123
This commit is contained in:
@@ -19,7 +19,12 @@ namespace Infrastructure
|
||||
public static string HttpPost(string url, string postData = null, string contentType = null, int timeOut = 30, Dictionary<string, string> headers = null)
|
||||
{
|
||||
postData ??= "";
|
||||
using HttpClient client = new HttpClient();
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true //忽略掉证书异常
|
||||
};
|
||||
|
||||
using HttpClient client = new HttpClient(httpClientHandler);
|
||||
client.Timeout = new TimeSpan(0, 0, timeOut);
|
||||
if (headers != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user