【发布时间】:2012-05-09 04:18:33
【问题描述】:
我正在努力弄清楚如何从我的 Windows Phone 7 应用程序中使用 Trello 的 OAuth API 调用。除了listing of the endpoints,API 并没有真正记录在案。
这是我目前所拥有的:
public void OnAuthenticateClicked(object sender, EventArgs e)
{
const string consumerKey = "mykey";
const string consumerSecret = "mysecret";
const string baseUrl = "https://trello.com/1";
var client = new RestClient(baseUrl)
{
Authenticator = OAuth1Authenticator.ForRequestToken(consumerKey, consumerSecret)
};
var request = new RestRequest("OAuthGetRequestToken", Method.POST);
var response = client.ExecuteAsync(request, HandleResponse);
}
private void HandleResponse(IRestResponse restResponse)
{
var response = restResponse;
Console.Write(response.StatusCode);
}
我收到了404 的回复,所以很明显有些地方不对劲。
有什么建议吗?
【问题讨论】:
-
谢谢,但这也没用。
-
如果您不使用 ExecuteAsync(例如
IRestResponse response = client.Execute(request);),它是否有效?这使得第一步(OauthGetRequestToken位)对我有用。
标签: windows-phone-7 oauth restsharp trello