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;
 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;
 await ClientInternal.RestActionAsync <TResult>(async c => await c.DeleteAsync(ClientInternal.BuildUrl(url, query)), client);
Example #4
0
 await ClientInternal.RestActionAsync <TResult>(async c => await c.GetAsync(ClientInternal.BuildUrl(url, query), HttpCompletionOption.ResponseHeadersRead), client);