I am trying to make a HTTP/2.0 request but cant get it to work. According to this and other posts https://stackoverflow.com/a/53776383/18171693 .NET > 3.0 shall support it but I can not get it to work.
Debug.WriteLine("Version:"+ Environment.Version.ToString());
var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get,"https://http2.akamai.com/demo")
{
Version = new Version(2, 0)
};
var x = await client.SendAsync(req);
The code above generates:
Version:4.0.30319.42000
Exception thrown: 'System.ArgumentException' in mscorlib.dll
An exception of type 'System.ArgumentException' occurred in mscorlib.dll but was not handled in user code
Only HTTP/1.0 and HTTP/1.1 version requests are currently supported.