/// <summary>
 /// 转换为FormUrlEncodedContent对象
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static HttpContent ToFormUrlEncodedContent <T>(this T data) where T : class
 {
     if (data is string)
     {
         return(new FormUrlEncodedContent(JsonKeyValuePair.Deserialize(data.ToString())));
     }
     else
     {
         return(new FormUrlEncodedContent(JsonKeyValuePair.BuidKeyValues(data)));
     }
 }
Exemple #2
0
 /// <summary>
 /// 转换为FormUrlEncodedContent对象
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static HttpContent ToFormUrlEncodedContent <T>(this T data) where T : class
 {
     return(new FormUrlEncodedContent(JsonKeyValuePair.Deserialize(data)));
 }