赞
踩
var request = new RestRequest(baseRequest.Method);
request.AddHeader("Content-Type", baseRequest.ContenType);
if (baseRequest.Parameter != null)
request.AddParameter("param", JsonConvert.SerializeObject(baseRequest.Parameter), ParameterType.RequestBody);
client.BaseUrl = new Uri(apiUrl + baseRequest.Route);
var response = await client.ExecuteAsync(request);
JsonSerializerSettings jsSetting = new JsonSerializerSettings();
jsSetting.NullValueHandling = NullValueHandling.Ignore;
if (response.StatusCode == System.Net.HttpStatusCode.OK)
return JsonConvert.DeserializeObject<WebApiResponse<T>>(response.Content, jsSetting);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。