I\'m experimenting with the Heroku API using the .NET System.Net.Http.HttpClient
. In particular, I want keep-alive
to work so that I can send many
Use WebRequestHandler class instead of HttpClientHandler and set property HttpWebRequest.UnsafeAuthenticatedConnectionSharing to True.
Some proxy servers will ignore the keep-alive when doing their authentication. If I recall correctly it's when the proxy server uses NTLM authentication.
In the past, I've had to add a partial class to "help" some web service proxy classes.
I overrode the GetWebRequest(Uri uri) method with
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest)base.GetWebRequest(uri);
webRequest.ProtocolVersion = HttpVersion.Veraion10; // I know this is strange, but it works
webRequest.ServicePoint.Expect100Continue = false; // This is where the magic lives
return webRequest;