Exemplo n.º 1
0
 public static async Task <TResult> PostAsync <TResult>(string url, Query query = null, Body body = null, HttpClient client = null)
     where TResult : class =>
 (await ClientInternal.RestActionAsync <TResult>(async c =>
 {
     if (body == null)
     {
         return(await c.PostAsync(ClientInternal.BuildUrl(url, query), null));
     }
     using (var content = body.GetContent())
         return(await c.PostAsync(ClientInternal.BuildUrl(url, query), content));
 }, client)).Item1;
Exemplo n.º 2
0
 public static async Task <TResult> PostHttpContentAsync <TResult>(string url, Query query = null, HttpContent content = null, HttpClient client = null)
     where TResult : class =>
 (await ClientInternal.RestActionAsync <TResult>(async c => await c.PostAsync(ClientInternal.BuildUrl(url, query), content), client)).Item1;