public static async Task <string> RequestPostAsync(IRequestModel model) { var postData = RequestFactory.CreatePost(model); var resp = await $"{AppConsts.Protocol}://{AppConsts.Gateway}".PostUrlEncodedAsync(postData); resp.EnsureSuccessStatusCode(); var resultData = await resp.Content.ReadAsStringAsync(); return(resultData); }
public static async Task <T> RequestPostAsync <T>(IRequestModel model) { var postData = RequestFactory.CreatePost(model); return(await $"{AppConsts.Protocol}://{AppConsts.Gateway}".PostUrlEncodedAsync(postData).ReceiveJson <T>()); }