my6solutions

asp .net, the social web & other distractions

 

Running Apps


PayPal - The safer, easier way to pay online!

Disclaimer

I am in no way affiliated with Microsoft or Google. I am just another developer trying to make a difference. All opinions and observations are usually my own.

BlogEngine.NET Twitter plugin

I sidetracked today. I had a go at implementing a Twitter plugin for BlogoEngine.NET. As usual, my lazy self got me googling to see if someone else has already done the job.
Nope, couldn't find any plugin except bits and pieces of code here and there.

Also, found out that there are 2 twitter clients out there at the moment so you don't have to log into the twitter site just to tweet. twhirl and TweetDeck, are both Adobe Air applications that run from your desktop.

In the end, I settled for the Yedda Twitter C# Library. It looked pretty straight-forward.


However,while attempting to post my first tweet from the Admin section, twitter barfed and returned a "(417) Expectation Failed".WTF?! After a double check on my login credentials, which were fine, I resorted to google again and it seems that this was a known problem and a solution has already been found.


It seems that, in an attempt to reduce request hits on its servers, twitter started to reject POST web requests containing the "100-Continue" Expect HTTP header. As stated in RFC2616, the 100 Continue status is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.
In .NET, this header is automatically included to cater for most situations where redirects and authorizations are usually expected.

To prevent .NET from including this header, the following line is added

ServicePointManager.Expect100Continue = false;

Bookmark and Share

Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Hits Tech Gadgets

Thursday, March 12, 2009 9:45 PM

Hits Tech Gadgets

its a very good combination...