本文介绍了有什么方法可以使用新的http/2 API在C#中发送推送通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了几种选择,最接近的是 httptwo ,但是它确实似乎还没准备好生产,我还尝试将HttpClient的版本设置为2.0,但是调用不会通过,我认为.NET中对Http/2的支持还不完整.有什么想法吗?

解决方案

当前,在标准.NET框架中,HttpClient不支持HTTP/2.但是,在.NET Core框架中,它是..但它必须在Windows 10上运行(或者,我假设是Windows Server 2016).您还只需使用异步方法.

还有一个名为System.Net.Http.WinHttpHandler的软件包,您可以通过支持标准.NET上的HTTP/2的Nuget获得.

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?

解决方案

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

这篇关于有什么方法可以使用新的http/2 API在C#中发送推送通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:47