コード例 #1
0
 public static async Task <T> GetAndReadAsObjectFromJsonAsync <T>(this McmaHttpClient client,
                                                                  string url,
                                                                  IDictionary <string, string> queryParams = null,
                                                                  IDictionary <string, string> headers     = null)
 =>
 await(await client.GetAsync(url, queryParams, headers).WithErrorHandling()).Content.ReadAsObjectFromJsonAsync <T>();
コード例 #2
0
 public static async Task <T[]> GetAndReadAsArrayFromJsonAsync <T>(this McmaHttpClient client,
                                                                   string url,
                                                                   IDictionary <string, string> queryParams = null,
                                                                   IDictionary <string, string> headers     = null)
 => await client.GetAsync(url, queryParams, headers).ReadAsArrayFromJsonAsync <T>();
コード例 #3
0
 public static async Task <HttpResponseMessage> PatchAsJsonAsync(this McmaHttpClient client, string url, object body)
 => await client.PatchAsync(url, new StringContent(body.ToMcmaJson().ToString(), Encoding.UTF8, "application/json"));