此行因未处理的异常而中断我的应用程序

时间:2017-05-03 07:47:34

标签: c# android xamarin cross-platform

此行因未公开的异常而中断我的申请。

var client = new HttpClient();
var responseMessage =await client.GetAsync("http://localhost:63650/api/student");

//HttpContent content = responseMessage.Content;
//var json = await content.ReadAsStringAsync();


var RestUrl = "http://localhost:63650/api/student";
var uri = new Uri(string.Format(RestUrl, string.Empty));

var response = await client.GetAsync(uri);
if (response.IsSuccessStatusCode)
   {
   var content = await response.Content.ReadAsStringAsync();
   var item = JsonConvert.DeserializeObject<List<Student>>(content);
   }

0 个答案:

没有答案