How to disable the “Expect: 100 continue” header in WinRT's HttpWebRequest

DVD picture DVD · Jan 30, 2013 · Viewed 24.9k times · Source

I'm developing an app that for legacy code reasons I can't upgrade for the new HttpClient so I'm using HttpWebRequests.

In .NET 4 we could deactivate the Expect header (on posts requests) using ServicePoint.Expect100Continue property, but on WinRT it's not available.

How can this be accomplished on WinRT?

EDIT: System.Net.ServicePointManager.Expect100Continue is not available either.

Answer

Flatliner DOA picture Flatliner DOA · Feb 3, 2013
        var c = new HttpClient();
        c.DefaultRequestHeaders.ExpectContinue = false;