HttpWebRequest.ProtocolVersion - how do I set it to try 1.0, then 1.1 (or vice versa)?

David Thielen 3,116 Reputation points
2020-12-06T23:33:10.243+00:00

We have a commercial library and some of our customers need

HttpWebRequest.ProtocolVersion=HttpVersion.Version10 

and some need

HttpWebRequest.ProtocolVersion=HttpVersion.Version10

Is there a way to tell it to try both? Or do I need to add a configuration setting for the 1.0 people (yuck)?

Also asked on StackOverflow

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,159 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Cheong00 3,476 Reputation points
    2020-12-08T03:52:30.89+00:00

    I think the most feasible solution would be to deploy Nginx as forward proxy with your program to visit those URL with "proxy_http_version 1.0", then point the defaultProxy setting of your application to it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.