SaahilClaypool / PollyFlurl

Flurl polly integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

About

Flurl polly integration

License:MIT License


Languages

Language:C# 100.0%