首页 > 代码库 > UWP开发:网络请求数据返回:Id =42 , Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}

UWP开发:网络请求数据返回:Id =42 , Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}

今天突然遇到一个问题,UWP中网络请求返回:Id = 42, Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}。

请求api是正确的,在浏览器内测试可以请求到数据,但是执行程序就是获取不了正确数据。郁闷了半天,突然才发现,由于我写的是异步网络请求的方法,而在调用时,忘记加 await async 关键字,导致没有异步调用。所以返回了Id = 42, Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}。解决方法就是加上 await ,async,采用异步就可以了。

欢迎热爱UWP开发的同学加群:193148992 共同学习交流。

 

UWP开发:网络请求数据返回:Id =42 , Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}