public static string GetGat(string url)
{
string test = string.Empty;
using (var httpClient = new HttpClient())
{
HttpResponseMessage response = httpClient.GetAsync(new Uri(url)).Result;
string result = response.Content.ReadAsStringAsync().Result;
test = result;
}
return test;
}
nuget下载HttpClient,
引用using System.Net.Http;