简体   繁体   中英

HttpClient TimeOut/Cancelled exception

When I post data Timeout/Cancelled exception is thrown (in Cent Os 7, server nginx) but it is perfectly fine when run on windows.

Is there a workaround for this? It works fine when I call api within same application.

Here is my complete error:

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:\GitHub\CardApp\CardApp\Repository\Notifer.cs:line 59

Update: Problem is when we are posting to https enabled apis.. Post request to http works fine.. It is because of client side encryption problem..

It happened because server was unable to ping the url. I had it fixed after contacting server people. I got to know about it after posting a curl..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM