【发布时间】:2012-03-01 08:21:48
【问题描述】:
我已经构建了一个带有“使用 google 登录”功能的 windows phone 7 应用程序。 Google 库与 windows phone 运行时不兼容,所以我选择 RestSharp。
应用已成功接收到来自 Google 的验证码,下一步是将验证码交换为访问令牌和刷新令牌。在这里我遇到了一些问题。
var request = new RestRequest(this.TokenEndPoint, Method.POST);
request.AddParameter("code", code);
request.AddParameter("client_id", this.ClientId);
request.AddParameter("client_secret", this.Secret);
request.AddParameter("redirect_uri", "http://localhost");
request.AddParameter("grant_type", "authorization_code");
client.ExecuteAsync<???>(request, (response) =>
{
var passIn = response;
}); // how to use this method?
我不知道如何使用client.ExecuteAsync<T> 方法(或任何其他有帮助的方法)从 Google 获得响应。是否有任何其他代码预先要求我使用这种方法?有人可以帮帮我吗?
【问题讨论】:
标签: c# .net windows-phone-7 restsharp