Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Uploading tweet with media

$
0
0
I always get these error while using PublishTweetWithMedia.
POST : https://api.twitter.com/1.1/statuses/update_with_media.json
...
An exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll and wasn't handled before a managed/native boundary
System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Tweetinvi.WebLogic.TwitterRequestGenerator.MultipartWebRequest.<>c__DisplayClass6.<>c__DisplayClass8.<GetResult>b__5(IAsyncResult a)
this is my script:
byte[] imageData = ReadFile(imageFileName);
if(imageData != null && imageData.Length > 0){
    TwitterCredentials.SetCredentials(token, tokensecret, TwitterSettings.ConsumerKey, TwitterSettings.ConsumerKeySecret);
    await TweetAsync.PublishTweetWithMedia("tes #GIFMe", imageData);
    //await TweetAsync.PublishTweet("tes #GIFMe");
}
The PublishTweet is working fine, but the PublishTweetWithMedia is not.
I use ReadFile function from your previous comment to read image from isolated storage.

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>