It appears as though UWP has a new HttpClient in the Windows.Web.Http namespace which has HTTP 2.0 support: https://msdn.microsoft.com/en-us/library/windows/apps/mt187345.aspx
Is porting this work to the coreclr HttpClient in the roadmap?
cc; @SidharthNabar
@callumelgrant - There are a few aspects to this:
HttpRequestMessage.Version to HttpVersion.Http20, and the underlying stack will then use HTTP/2..NET Core for ASP.NET 5 on Windows - Not yet (this is on our roadmap)
:+1: Awesome!
@SidharthNabar: you've mentioned that http/2 support for _.NET Core for ASP.NET 5_ and _.NET Framework 4.6_ is already on your roadmap. Is this roadmap publicly available somewhere? Do you have an approximate timeline for that?
cc: @himadrisarkar @CIPop
HTTP/2.0 support will be added post RTM for .NET Core 1.0 to a future iteration of the System.Net.Http package. And that package can also be installed for .NET Framework 4.6 applications.
The NuGet package will be required to get HTTP/2.0 functionality. We do not plan to add HTTP/2.0 directly to the .NET Framework 4.6.* runtime.
HTTP/2.0 support will be added post RTM for .NET Core 1.0 to a future iteration of the System.Net.Http package.
Cool. Do you know if this will support server-push aspects of the spec? It would be nice if this (https://github.com/Redth/HttpTwo) incomplete implementation could be replaced.
Any updates?
HTTP/2.0 support will be added post RTM for .NET Core 1.0 to a future iteration of the System.Net.Http package.
Cool. Do you know if this will support server-push aspects of the spec? It would be nice if this (https://github.com/Redth/HttpTwo) incomplete implementation could be replaced.
This was completed in PR dotnet/corefx#10948.
In terms of full support server-push aspects of the spec....no, on Windows System.Net.Http using the OS native component WinHTTP for the HTTP stack. WinHTTP does not fully support server-push aspects.
Thanks for the quick reply, is it on a roadmap anywhere or can you recommend alternatives on Windows?
Thanks for the quick reply, is it on a roadmap anywhere or can you recommend alternatives on Windows?
In term of full support for server-push aspects of the spec, I have no information yet on timelines for that. That requires getting information from the WinHTTP team about the feature plans for Windows 10 updates. I will forward this inquiry to the team and see if I can get an answer.
In terms of alternative client HTTP stacks on Windows that support HTTP/2.0 protocol including full support for server-push aspects....I don't have any information on that.
I am trying to call a http/2 api using HttpClient in a project targeting 4.6.2 and can't find HTTP 2.0 support. System.Net.HttpVersion has only Version10 and Version11. Just want to confirm if I Http/2 is supported for Httpclient in Framework 4.6.2 ?
Just want to confirm if I Http/2 is supported for Httpclient in Framework 4.6.2 ?
HTTP/2 protocol is NOT supported on any version of .NET Framework binaries.
To use HTTP/2 protocol support, you must use .NET Core. You must also use a supported version of Windows 10. And you need to manually specify HttpRequestMessage.Version = new Version(2,0);
You can also use the separate System.Net.Http.WinHttpHandler package which provides an alternate handler for HttpClient. You need to create that WinHttpHandler and pass it into the constructor of HttpClient. This WinHttpHandler package is supported on both .NET Core .NET Framework.
Thanks for the quick reply. In second option WinHttpHandler. Do I just need to change the version to 2.0 or it would require any other changes?
First, discussions on closed issues such as this are not guaranteed to get a response from anyone since the issue is closed.
Second, you can use WinHttpHandler on .NET Framework. You must only use the SendAsync() methods from HttpClient. Those are the only ones that allow you to pass in an HttpRequestMessage. Other methods, use a default HttpRequestMessage that uses Version(1,1) only.
You have to set the .Version field in HttpRequestMessage to 2.0 as indicated. You have to use a current version of Windows 10.
Other than that, HTTP/2 protocol should work against an HTTP/2 server. You'll know if works when you get an HttpResponseMessage with Version field set to 2.0.
Most helpful comment
First, discussions on closed issues such as this are not guaranteed to get a response from anyone since the issue is closed.
Second, you can use WinHttpHandler on .NET Framework. You must only use the SendAsync() methods from HttpClient. Those are the only ones that allow you to pass in an HttpRequestMessage. Other methods, use a default HttpRequestMessage that uses Version(1,1) only.
You have to set the .Version field in HttpRequestMessage to 2.0 as indicated. You have to use a current version of Windows 10.
Other than that, HTTP/2 protocol should work against an HTTP/2 server. You'll know if works when you get an HttpResponseMessage with Version field set to 2.0.