The 2nd time it will wait 2 seconds and retry. To implement the retry policy with Polly, we will tell it to handle an HttpResponseMessage result on which we will check the IsSuccessStatusCode property to determine whether the request was successful or not.
Polly, HttpClientFactory and the Policy Registry - no dogma blog Best practices with HttpClient and Retry Policies with Polly in .NET ... Polly is a .net library / SDK which can be used to perform policies on HTTP requests, for example, retrying a request until a specific … Retry Policy. I want to get the exception in case the retry operation fails and retry again 2 times and so on. This is how we can deal with both transient and long term downtime in dependent services and keep application stable and robust.
Using Polly for a retry attempt from an async function Learn how to use CSharp api Polly.Policy.Handle() Home; Search C# Examples; Popular CSharp Api Examples; Browse Source Code; Contact Us; CSharpCodi Learn c# by example.