Reputation: 559
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?
Upvotes: 0
Views: 441
Reputation: 1399
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
Upvotes: 1