简体   繁体   中英

Getting Twitter Home timeline throw Error in windows Phone App Using twitter Api v1.1

I am Trying to Get Latest Tweets in my Twitter Home Time Line to my Windows Phone App

Hear is My Code:

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);
}

I'm getting error at My e.Result

Error : An exception of type 'System.Net.WebException' occurred in System.ni.dll but was not handled in user code

How can I solve this problem?

Twitter API 1.1 doesn't allow you to make unauthenticated web service calls. You need to authenticate with OAuth or App only authentication.
Details: https://dev.twitter.com/docs/api/1.1/overview#Authentication_required_on_all_endpoints

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM