1234567891011121314151617 |
- using System.Net.Http;
- using System;
- using System.Threading.Tasks;
- namespace WingPaymentService.Common.WeChat
- {
- public class WxPayHttpRequest
- {
- private HttpClient _request = new();
- public async Task<string> Post(string xml, string url, int timeout)
- {
- _request.Timeout = TimeSpan.FromSeconds(timeout);
- var result = await _request.PostAsync(url, new StringContent(xml));
- return await result.Content.ReadAsStringAsync();
- }
- }
- }
|