#region GET请求
/// <summary>
/// Get请求
/// </summary>
/// <param name="url">api的Controller/Action</param>
/// <param name="id">信息标识</param>
/// <returns></returns>
public string GET(string url, string id)
{
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("KeepAlive", "false");
var result = httpClient.GetAsync(apiurl + url + "/" + id).Result.Content.ReadAsStringAsync().Result;
return result;
}
#endregion
/// <summary>
/// Get请求
/// </summary>
/// <param name="url">api的Controller/Action</param>
/// <param name="id">信息标识</param>
/// <returns></returns>
public string GET(string url, string id)
{
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("KeepAlive", "false");
var result = httpClient.GetAsync(apiurl + url + "/" + id).Result.Content.ReadAsStringAsync().Result;
return result;
}
#endregion