Example #1
0
 /// <summary>
 /// Get请求JSON
 /// </summary>
 /// <param name="httpClient">http客户端</param>
 /// <param name="url">URL</param>
 /// <param name="customerOptions">自定义选项配置</param>
 /// <returns>返回字符串</returns>
 public static string Get(this HttpClient httpClient, string url, Action <ChannelCustomerOptions> customerOptions = null)
 {
     return(httpClient.RequestJson(url, "Get", httpContent =>
     {
         return httpClient.GetAsync(url);
     }, customerOptions));
 }
Example #2
0
 /// <summary>
 /// Patch请求JSON
 /// </summary>
 /// <param name="httpClient">http客户端</param>
 /// <param name="url">URL</param>
 /// <param name="data">数据</param>
 /// <param name="customerOptions">自定义选项配置</param>
 /// <returns>返回字符串</returns>
 public static string PatchJson(this HttpClient httpClient, string url, object data = null, Action <ChannelCustomerOptions> customerOptions = null)
 {
     return(httpClient.RequestJson(url, "Patch", httpContent =>
     {
         return httpClient.PatchAsync(url, httpContent);
     }, data, customerOptions));
 }