How to make the .net HttpClient use http 2.0?

前端 未结 4 1529
一生所求
一生所求 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 05:35

    HttpClient does not support HTTP/2 yet. It will be available in the next release (code name KATANA). Here is the link to their source code for the next release.

    Till then, you could implement your own HttpMessageHandler object that implements HTTP/2 and pass it to the HttpClient's constructor (you probably can use their source code from KATANA).

提交回复
热议问题