如何在Xamarin表单中使用applicationKey来使用服务api?

时间:2017-09-27 04:19:40

标签: c# xamarin asp.net-web-api

我是Windows应用开发的新手。我正在尝试使用移动服务客户端使用以下代码块来使用服务api

 MobileServiceClient mSClient;
 mSClient = new MobileServiceClient("https://*******.azure-mobile.net/", "UFakeKkrayuAeVnosdfghrwvnhdfVAcjYziYFSFHUV89");

 Dictionary<string, string> userobj = new Dictionary<string, string>();
 userobj.Add("UserName", "username");
 userobj.Add("Password", "password");
 userobj.Add("DeviceUID", "010092780200134E0300215F0400CC37050083D807006B9B080066010900267F");
 userobj.Add("DeviceToken", "device_123");
 userobj.Add("OSVersion", "WindowsPhone");
 userobj.Add("AppVersion", "2.0");
 userobj.Add("DeviceModel", "Windows phone");
 userobj.Add("DeviceTypeID", "1");
 userobj.Add("DeviceAlertsOn","true");      

 var responce = mSClient.InvokeApiAsync("user/loguserin", HttpMethod.Post, userobj);

但我没有得到适当的回应:

enter image description here

任何人都可以帮我吗?

谢谢, SRINIVAS。

1 个答案:

答案 0 :(得分:1)

等待异步方法,因此您看到WaitingForActivition的状态:

var responce= await mSClient.InvokeApiAsync(.......