http/2 support

Jakob Aagesen 136 Reputation points
2023-01-11T14:26:39.8366667+00:00

I don't think the standard HttpClient() can be setup to use the http/2 protocol? I cannot change the version of that to 2.

I am using .NET Framework 4.6.2

Can anyone tell me what lib. i need to reference, to be able to communicate via http/2?

Developer technologies .NET Other
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-01-11T16:47:36.6666667+00:00

    the .net 4.* framework has very limited http/2 support. It's been on the roadmap for years, but no real progress. you might find some unsupported nuget libraries (interest seemed to drop once core has support).

    the grpc library for 4.6 has limited support for http/2:

    [https://learn.microsoft.com/en-us/aspnet/core/grpc/netstandard?view=aspnetcore-7.0

    note: support for 4.* is really limited to bug fixes, not new features or protocols

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Zsolt Hajdu 156 Reputation points
    2023-01-11T14:45:52.5566667+00:00

    HttpClient doesn't support Http/2
    You can write a custom HttpMessageHandler and set request version to Http/2
    or use KATANA (you can find it on github), but that project is a little bit old

    request.Version = HttpVersion.Version20;
    
    0 comments No comments

  2. Jakob Aagesen 136 Reputation points
    2023-01-13T15:13:20.6333333+00:00

    hi

    Thank you for the replies.

    It's a shame that it is not easy to migrate .Net framework to .Net 7. It's the same with the WebSocket library. After Core came, no support is available for the Framework libraries.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.