tmenier / Flurl

Fluent URL builder and testable HTTP client for .NET
https://flurl.dev
MIT License
4.23k stars 387 forks source link

Make Flurl.Http compatible with Polly v8 #790

Closed jassent closed 11 months ago

jassent commented 11 months ago

Flurl and Flurl.Http are an awesome combo. Unfortunately they are currently incompatible with Polly v8 for implementing retry/resilience logic.

The Flurl.Http AddMiddleware() method works great with Polly v7 but is incompatible with Polly v8.

The issue is that Polly v8 doesn't provide a DelegatingHandler. So I guess this more of a Polly v8 issue than a Flurl.Http issue.

This Sundry.Extensions.Http.Polly seems to get pretty close on how to setup a DelegatingHandler. Refer to the PollyStrategyHttpMessageHandler.cs

Here is a post on StackOverlow with a workaround for getting Flurl.Http to work with Polly v8.

Thank you again for a great library!

tmenier commented 11 months ago

I think there could be some useful information here for #346, which is a high post-4.0 priority. Could you add these comments there? At its core I don't think this a separate issue, and I'd rather keep it all together. Thanks!

jassent commented 11 months ago

Moved to #346