AggregateException is throwing while waiting for API post to complete how i could fix this?
My API call is similar like this
using (var httpClient
Are you posting a big piece of data ? Once I had a similar issue. I believe the underlying problem is occasional timeout due to bandwidth issues. I tried getting the task and manually waiting on it then checking .IsFaulted
and .IsCancelled
but the .Result
throws AggregateException
/ TaskCancelledException
.
Maybe you should try to increase HttpClient.Timeout property which is 100 sec by default ?