有什么办法可以使用新的 http/2 api 在 C# 中发送推送通知吗? [英] Is there any way to use the new http/2 api to send push notifications in C#?

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

问题描述

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

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?

推荐答案

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

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.

还有一个叫做 System.Net.Http.WinHttpHandler 的包,你可以通过 Nuget 在标准 .NET 上支持 HTTP/2

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# 中发送推送通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆