问题描述
我在UWP应用中使用HttpClient。但是HttpClient不会在某些设备上创建http请求。我不知道为什么。如果它是任何缺少的依赖或什么。所有设备都有操作系统Windows 10和禁用的防火墙。
I use HttpClient in my UWP app. But the HttpClient does not create http requests on some devices. I don't know why. If it is any missing dependencies or what. All devices have OS Windows 10 and disabled firewall.
当我在C#.NET控制台应用程序中使用HttpClient时,它适用于所有设备。
It works well for all devices, when I use HttpClient in C# .NET Console Application.
推荐答案
第一个来自System.Net.Http;
The first is from System.Net.Http;
第二个是来自Windows.Web.Http;
The second is from Windows.Web.Http;
建议UWP使用Windows.Web.Http。
the UWP be suggested use Windows.Web.Http.
参考:
https://docs.microsoft.com/en-us/uwp/api/windows.web.http.httpclient
这篇关于[UWP] [C#] - HttpClient在某些W10设备上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!