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.
The client will expect to receive a 100-Continue response from the server to indicate that the client should send the data to be posted. This mechanism allows clients to avoid sending large amounts of data over the network when the server, based on the request headers, intends to reject the request.
HttpWebRequest automatically appends an Expect: 100-continue header for POST requests. Various sources around the internet suggest that this can be disabled as follows: System. Net.
var c = new HttpClient(); c.DefaultRequestHeaders.ExpectContinue = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With