Hi Sashka, Take a look at this article regarding this error: http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c-resolved You may need to instruct the HTTP client to not send the "Expect: 100-Continue" HTTP header.
Taylor On Tue, Sep 7, 2010 at 7:14 AM, sashka <[email protected]> wrote: > > i'm using OAuthBase.cs from oauth.googlecode.com for generate > signature. > > public static void > Status_Update() > { > OAuthBase oAuth = new OAuthBase(); > > string consumerKey = "My consumer key "; > string consumerSecret = " My consumer secret "; > string oauth_token = " token "; > string oauth_token_secret = " token secret "; > Uri > uri = new Uri("http://api.twitter.com/1/statuses/ > update.xml"); > > string normUri; > string normParams; > > string timeStamp = oAuth.GenerateTimeStamp(); > string nonce = oAuth.GenerateNonce(); > string oauth_signature = oAuth.GenerateSignature(uri, > consumerKey, > consumerSecret, oauth_token, oauth_token_secret, "POST", timeStamp, > nonce, > OAuth.OAuthBase.SignatureTypes.HMACSHA1, out normUri, out normParams); > > WebClient wcl = new WebClient(); > wcl.Headers.Add("Authorization: OAuth " + > "oauth_nonce=\""+ nonce +"\", " + > "oauth_signature_method=\"HMAC-SHA1\", " + > "oauth_timestamp=\""+timeStamp+"\", " + > "oauth_consumer_key=\""+consumerKey+"\", " + > "oauth_token=\""+oauth_token+"\", " + > "oauth_signature=\""+oauth_signature+"\", " + > "oauth_version=\"1.0\""); > > wcl.Encoding = System.Text.Encoding.UTF8; > Console.WriteLine("Out:{0}?{1}", normUri, > normParams); > string reply = wcl.UploadString(normUri, "POST", normParams); > Console.WriteLine(reply); > } > Why don't work? > > Unhandled Exception: System.Net.WebException: The remote server > returned an error: (417) Expectation Failed. > > -- > Twitter developer documentation and resources: http://dev.twitter.com/doc > API updates via Twitter: http://twitter.com/twitterapi > Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list > Change your membership to this group: > http://groups.google.com/group/twitter-development-talk?hl=en -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk?hl=en
