Is there any way to use the new http/2 api to send

2019-05-11 17:14发布

问题:

I have tried several options, the closest I've got was with httptwo, but it does not seem production ready, I've also tried with HttpClient setting version to 2.0, but the call won't pass, I think Http/2 support in .NET is not complete. Any ideas?

回答1:

Currently, in the standard .NET framework, HTTP/2 is not supported in HttpClient. However, in the .NET Core framework, it is.. but it requires to be run on Windows 10 (or, I assume Windows Server 2016). You also have to use only the async methods.

There is also a package called System.Net.Http.WinHttpHandler, which you can get through Nuget that supports HTTP/2 on standard .NET