1 HttpClient client = new HttpClient();
2 client.BaseAddress = new Uri(url);
3 client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
4 HttpResponseMessage response = client.GetAsync(url).Result;
5
6 if (response.IsSuccessStatusCode)
7 {
8 var result = response.Content.ReadAsStringAsync().Result;
9 var s = Newtonsoft.Json.JsonConvert.DeserializeObject(result);
10 return "Success";
11 }
12 else
13 {
14 return "Fail";
15 }
16