| | |
| | | { |
| | | public class HttpHelper |
| | | { |
| | | public static async Task<string> GetAsync(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static async Task<string> GetAsync(string serviceAddress, Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | } |
| | | |
| | | public static async Task<string?> PostAsync(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static async Task<string?> PostAsync(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate); |
| | | Logger.Add(serviceAddress, requestJson, result, beginDate); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public static string Post(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static string Post(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate); |
| | | Logger.Add(serviceAddress, requestJson, result, beginDate); |
| | | } |
| | | } |
| | | } |