Dear visitor, thanks for stopping by! If you want, you can follow all updates on Snowball.be via RSS. You can also follow me on Twitter or Facebook. More interesting posts from other Microsoft Regional Directors can be found at The Region.
Gill Cleeren     Silverlight | Twitter     July 23, 2009    

I’m currently creating a Silverlight Twitter client and ran into an error that seems quite well known when developing against the Twitter API, namely the 417 Expectation Failed error or status message.

The solution is – and this works with the WebClient as well as the WebRequest – adding the following line before making the call to Twitter:

ServicePointManager.Expect100Continue = false;

This is not needed for every request: if you are for example adding a status update over the API, then you need to add it. If you are simply requesting a list of messages (friends timeline for example), it’s not needed. So far, everything was OK with my app as well.

However, if you only add it to the places where it’s needed (like said when adding a status) and omitting it in other places, will cause the same error. Turns out that a status update will fail with the same message if you have in the same session queried a list without setting the Expect100Continue.

Bottom line of this story: always set it. It will make your life easier!

  Posted on: Thursday, July 23, 2009 2:52:53 PM (Romance Daylight Time, UTC+02:00)   |   Comments [2]
         
Thursday, July 23, 2009 5:26:46 PM (Romance Daylight Time, UTC+02:00)
Hi Gill,

Just one quick question here. Are you connecting directly to the Twitter API from Silverlight or are you going through a ASP.NET webservice?

I am curious because a while ago, I also tried to connect to an API (Basecamp) directly from Twitter and ran into troubles because it used Basic Authentication (see: http://www.hufkens.net/2009/05/silverlight-and-basic-authentication/).

Thanx,
Alain

Friday, July 24, 2009 9:04:00 AM (Romance Daylight Time, UTC+02:00)
Hi Alain,
I'm connecting the Silverlight app to a local service and have that service connect with Twitter, since Twitter's cross domain file won't allow Silverlight client-side apps to connect (cross domain restrictions).
Comments are closed.
2/8/2012   9:14:05 PM
 Welcome to Snowball.be
Hello and welcome to snowball.be!

My name is Gill Cleeren, I'm a Microsoft Regional Director and an MVP ASP.NET.
On Snowball.be, you'll find all kind news and articles on .net, ASP.NET, WPF, Silverlight and Microsoft in general.
More on me can be found on my about page.

Should you have any questions, don't hesitate to contact me by Send mail to the author(s) .

 Partner sites
 Most popular tags
.net (124) .net 3.0 (6) .net 3.5 (18) .NET 4 (18) .NET Show (1) ADO.net (4) ASP.net (53) ASP.net AJAX (4) ASP.NET MVC (3) Atlas (12) Azure (2) Blend (2) Book (5) Book review (4) C# (43) Case studies (1) Chopsticks (3) Community (10) Community Day (15) Consoles (1) Database (1) DevDays09 (4) DotNetNuke (4) Efficiency (57) Enterprise Library (5) Events (60) Expression (7) Games (3) Hardware (9) Internet (18) IT (1) jQuery (1) LightSwitch (3) Links (11) LINQ (4) Mac (2) Metro (1) Microsoft (75) Mix 07 (6) Mix 08 (4) Mix 09 (1) Mix 11 (1) Movies (4) MVP (5) MVP Summit 2008 (3) mvvm (1) Office 2007 (10) Other (8) PDC (22) PDC2008 (10) Personal (36) ppt (9) Programming (52) Programming tools (22) Regional Director (2) Silverlight (142) Silverlight Advent Calendar (24) sl4 (44) Slide decks (13) Snowball (13) Software (20) Microsoft (25) Speaking (14) SQL Server (10) TechDays (13) TechEd (14) telerik (6) Telerik (6) TFS (1) Twitter (1) Vista (73) Vista Tricks (9) Visual Studio.net (38) Visug (33) VS2010 (8) Wallpaper (2) WCF (2) Webcasts (9) Webinars (5) Windows (41) Windows 7 (5) Windows 8 (1) Windows Azure (2) Windows Mobile (3) Windows Phone 7 (2) WinFX (17) WinRT (1) WP7 (2) WPF (40) XAML (24)

 On this page
 This site
 Archives
Navigation
 Sitemap
 Blogroll OPML
 Disclaimer

All content is property of www.snowball.be. Nothing on this site can be copied or published elsewhere, unless otherwise stated.

This site is made by Gill Cleeren.

Questions? Opinions? Send mail to the author(s) E-mail