How to use Flurl with Polly without factory

时间:2019-04-17 00:49:40

标签: polly flurl

Following from Set a default Polly policy with Flurl

How do I use Polly with Flurl without the factory? This only calls it once

string s = await Policy
                        .Handle<HttpRequestException> ()
                        .OrResult <HttpResponseMessage> (r => !r.IsSuccessStatusCode)
                        .RetryAsync (5)
                        .ExecuteAsync (() => { Console.WriteLine ("Retry"); return "http://127.0.0:7071/".GetAsync (); })
                        .ReceiveString ()
                        .ConfigureAwait (false);

0 个答案:

没有答案