How to make the .net HttpClient use http 2.0?

前端 未结 4 1523
一生所求
一生所求 2020-12-05 05:30

I have an asp.net web api hosted on IIS 10 (windows server 2016). When I make a GET request to this from a Microsoft Edge browser, I see that HTTP 2.0

4条回答
  •  伪装坚强ぢ
    2020-12-05 06:01

    HTTP/2 looks like it will be supported in C# client calls with .NET 4.6.2

    https://msdn.microsoft.com/en-us/library/ms171868(v=vs.110).aspx

    HTTP/2 Support (Windows 10)

    HTTP/2 is a new version of the HTTP protocol that provides much better connection utilization (fewer round-trips between client and server), resulting in lower latency web page loading for users. Web pages (as opposed to services) benefit the most from HTTP/2, since the protocol optimizes for multiple artifacts being requested as part of a single experience. HTTP/2 support has been added to ASP.NET in the .NET Framework 4.6. Because networking functionality exists at multiple layers, new features were required in Windows, in IIS, and in ASP.NET to enable HTTP/2. You must be running on Windows 10 to use HTTP/2 with ASP.NET.

    HTTP/2 is also supported and on by default for Windows 10 Universal Windows Platform (UWP) apps that use the System.Net.Http.HttpClient API.

提交回复
热议问题