feat:收盘回调功能接口添加
This commit is contained in:
@@ -77,6 +77,24 @@ namespace YLErp.Modules.ApiModule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送Post请求
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<string> PostAsync(string url, string data, int timeoutSeconds = 15)
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
|
||||
var content = new StringContent(data, Encoding.UTF8, "application/json");
|
||||
var response = await client.PostAsync(url, content);
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST提交JSON请求到WebAPI并将返回字符串结果
|
||||
|
||||
Reference in New Issue
Block a user