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