/PollyFlurl.Core

Flurl polly integration

Primary LanguageC#MIT LicenseMIT

PollyFlurl

Flurl + Polly = resilient and easy HTTP requests.

Examples

var policy = Policy
    .HandleResult<HttpResponseMessage>(message =>
    {
        var content = message.Content.ReadAsStringAsync().Result;
        return content == "Bad Request";
    })
    .RetryAsync();

var response = await "http://www.google.com"
    .WithPolicy(policy)
    .GetAsync();
response.StatusCode.Should().Be(200);

built in transient retry handler

var response = await "http://www.google.com".RetryTransientErrors().GetAsync();

See Basic Tests for more examples.

TODO

  • Option for global configuration (asp.net core http client factory)