HttpClient超时/取消异常



当我发布数据时,会抛出Timeout/Cancelled异常(在Cent Os 7,服务器nginx中(,但在windows上运行时完全可以。

有解决办法吗?当我在同一个应用程序中调用api时,它工作得很好。

这是我的完整错误:

System.OperationCanceledException: The operation was canceled.
at System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at CardApp.Repository.Notifer.FCMSendNotification(NotificationRequest notification, String To) in C:GitHubCardAppCardAppRepositoryNotifer.cs:line 59

更新:问题是当我们发布到启用https的api时。。将请求发布到http运行良好。。这是因为客户端加密问题。。

这是因为服务器无法ping url。我在联系了服务器人员后修复了它。我是在贴了一张卷发后才知道的。。

相关内容

最新更新