update Infrastructure/Helper/HttpHelper.cs.

HttpPost 增加了timeout

Signed-off-by: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
This commit is contained in:
xbzhu 2023-02-15 08:15:10 +00:00 committed by Gitee
parent 9316669767
commit ccab3140ac
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
@ -22,6 +22,7 @@ namespace Infrastructure
postData = postData ?? ""; postData = postData ?? "";
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
client.Timeout = new TimeSpan(0, 0, timeOut);
if (headers != null) if (headers != null)
{ {
foreach (var header in headers) foreach (var header in headers)