Nope, but, boy, was it a coincidence! I use Scott Watermasysk's Graffiti Plug-in library to add Twitter notifications when I add new posts to this blog. Well, the weekend before last, I upgraded to Graffiti CMS 1.2 and blogged about it. The plug-in duly tweeted it. No problem.
The next post I made, on 23-Dec about Dell XPS support, wasn't. I eventually noticed, and wrote a fake manual tweet, resolving to work out what the issue was. Ditto for the next few blogs — it seems my resolutions don't have the force of real action — until this lunchtime, when I buckled down with some reheated Chick-fil-A nuggets to work out the problem.
Since the Twitter notification failure happened after I'd installed Graffiti 1.2, I couldn't really blame the upgrade. I looked at the Graffiti log and saw an error that looked like this:
Twitter Plugin
Your tweet could not be sent: The remote server returned an error: (417) Expectation Failed.
Ha! Moments later, using the famed tech support line that is Google, I came across this blog post that detailed the exact problem. Twitter in their infinite wisdom don't accept the "100-Continue" expectation http header any more. The default for .NET apps is to supply it, and therefore .NET Twitter notification code has been failing ever since 23 December.
Since Scott provides the source code to his plug-in, it was the matter of moments to add the single line of code to turn off the 100-Continue expectation...
1: //...
2:
3: // Create the web request
4: System.Net.ServicePointManager.Expect100Continue = false; // <-- new line
5: HttpWebRequest request =
6: WebRequest.Create("http://twitter.com/statuses/update.xml") as HttpWebRequest;
7:
8: //...
..and this post will be the test.
Now playing:
Kruder & Dorfmeister - Definition
(from G-Stoned)
8 Responses
#1 doWhileSomething said...
04-Jan-09 9:58 AMThanks for this, I wish some kind of distribution list could be created for users of their API.
This worked like a charm!
#2 julian m bucknall said...
04-Jan-09 10:45 AMGlad it helped!
Cheers, Julian
#3 Henrik said...
07-Mar-09 5:43 AMThanks, Julian.
Could you post the DLL with the fix for download?
#4 julian m bucknall said...
07-Mar-09 9:27 AMHenrik: I'll ping Scott to update his download with the fix, but until then you can get it here boyetblog.s3.amazonaws.com/.../ScottWater.Graf
Cheers, Julian
#5 tonex said...
19-Mar-09 12:34 AMI wonder why this doesn't work on mine. I'm using VS2008 and 3.5 Framework. I still get the 417 error.
#6 julian m bucknall said...
20-Mar-09 9:55 AMTonex: That I don't know, but make sure you are replacing the dll properly on your site. I was using VS2008 and .NET 3.5 as well.
Cheers, Julian
#7 regmee said...
29-Mar-09 9:58 AMSame with me. I couldn't get it fixed with the Expect100Continue fix. I guess, something more is broken now. Even the tested application QckTwit with the correction doesn't seem to work.
Any idea ???
#8 infopete said...
06-Jun-09 5:35 AMI've been having exactly the same problem using Quakk and my new twitter application.
I have just solved the problem with this:
This is under windows mobile using CF2.0
I hope it works for you too.
Leave a response
Note: some MarkDown is allowed, but HTML is not. Expand to show what's available.
_emphasis_
**strong**
[text](url)
`IEnumerable`
* an item
1. an item
> Now is the time...
Preview of response