Note that there are some explanatory texts on larger screens.

plurals
  1. POOAuth Headers Twitter 1.1 C# Fetching Tweets
    text
    copied!<p>After Twitter deprecated their Twitter API 1.0, I've tried several methods in order to get the 1.1 API working for my Windows 8 application. However, what you see below is basically what I've ended up with: </p> <pre><code> public List&lt;UserTweet.User&gt; jsonFromTwitter; private async void fetchTweet() { var jsonTwitter = new Uri("http://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=stackoverflow&amp;result_type=recent"); HttpClient client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, jsonTwitter); var oAuthHeader = "OAuth oauth_consumer_key=\"XXXXX\", oauth_nonce=\"XXXXX\", oauth_signature=\"XXXXX\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1318622958\", oauth_token=\"XXXXX-XXXXXX\", oauth_version=\"1.0\""; request.Headers.Add("Authorization", oAuthHeader); var response = await client.SendAsync(request); var responseString = await response.Content.ReadAsStringAsync(); jsonFromTwitter = JsonConvert.DeserializeObject&lt;List&lt;UserTweet.User&gt;&gt;(await client.GetStringAsync(responseString)); //listbox.ItemsSource = jsonFromTwitter; } </code></pre> <p>However, this won't do much good, and it switches between mainly a couple of errors. One of them can be seen below, and the other one is "Could not authenticate user" or similar, basically there's something wrong with the headers as far as I've understood. </p> <p><img src="https://i.stack.imgur.com/qkGi3.png" alt="Out of bounds or &quot;Could not authenticate&quot;"></p> <p>Anyone got any ideas on how to construct a working OAuth header for this? I'm clueless at the moment.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload