【发布时间】:2015-06-03 18:04:57
【问题描述】:
我尝试使用 RestSharp 从 Trello 获取请求令牌。我仅在请求线程中获得令牌,但无法将其保存在我的应用程序的变量中。 有一些代码:
private async void GetToken()
{
app.Client.Authenticator = OAuth1Authenticator.ForRequestToken(app.ConsumerKey, app.ConsumerSecret);
var request = new RestRequest("OAuthGetRequestToken", Method.POST);
app.Client.ExecuteAsync(request, HandleResponse);
}
private void HandleResponse(IRestResponse restResponse)
{
var Response = restResponse;
MessageBox.Show(Response.Content);
QueryString qs = new QueryString(Response.Content);
app.OAuthToken = qs["oauth_token"];
app.OAuthTokenSecret = qs["oauth_token_secret"];
app.Verifier = qs["verifier"];
MessageBox.Show(app.OAuthToken); //got token here, but after
MessageBox.Show(app.OAuthTokenSecret); //I don`t have anything in this variables
}
你有什么想法吗?
【问题讨论】:
标签: c# oauth windows-phone-8.1 restsharp trello