public static async Task <ApiResponse <T> > Post <T>(this HttpClient client, string url, object data) { var response = await client.PostAsync(url, HttpClientHelpers.GetJsonBody(data)); var qr = await QuickResponse <T> .FromMessage(response); return(qr.ToApiResponse()); }
public static async Task <ApiResponse <T> > PostMultipart <T>(this HttpClient client, string url, List <KeyValuePair <string, string> > parameters, List <HttpFile> files) { var response = await client.PostAsync(url, HttpClientHelpers.GetMultipartFormDataContentBody(parameters, files)).ConfigureAwait(false); var qr = await QuickResponse <T> .FromMessage(response); return(qr.ToApiResponse()); }
public static async Task <ApiResponse <T> > Post <T>(this HttpClient client, string url, Dictionary <string, string> parameters) { var response = await client.PostAsync(url, HttpClientHelpers.GetPostBody(parameters)); var qr = await QuickResponse <T> .FromMessage(response); return(qr.ToApiResponse()); }