获取推特主页时间线抛出错误在windows手机应用程序使用推特Api v1.1

本文关键字:应用程序 v1 手机 Api 时间线 主页 出错 获取 错误 windows | 更新日期: 2023-09-27 18:24:57

我正在尝试将我的推特主页时间线中的最新推文获取到我的Windows Phone应用程序

听是我的密码:

public void LoadData()
{
     WebClient tweetclient = new WebClient();
     string purl = string.Format("https://api.twitter.com/1.1/statuses/home_timeline.json?screen_name={0}&count=10", App.Tscreenname);
     tweetclient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(tweetclient_DownloadStringCompleted);
     tweetclient.DownloadStringAsync(new System.Uri(purl, UriKind.Absolute));
}
private void tweetclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
     var response = e.Result;
     var jsonData = JsonConvert.DeserializeObject<RootObject>(response);
}

我的e.Result 出现错误

错误:中发生类型为"System.Net.WebException"的异常System.ni.dll,但未在用户代码中处理

我该如何解决这个问题?

获取推特主页时间线抛出错误在windows手机应用程序使用推特Api v1.1

Twitter API 1.1不允许您进行未经验证的web服务调用。您需要使用OAuth或仅应用程序身份验证进行身份验证
详细信息:https://dev.twitter.com/docs/api/1.1/overview#Authentication_required_on_all_endpoints