tmenier / Flurl

Fluent URL builder and testable HTTP client for .NET

Home Page:https://flurl.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for CancellationToken in IFlurlResponse asynchronous methods

Prologh opened this issue · comments

Hi, will you be willing to add support for cancellation token in asynchronous methods of IFlurlResponse? Alternatively, accept a PR that adds that support? It can be a non-breaking change with those cancellation tokens having default value, similar to SendAsync() method from IFlurlRequest.

I'd like to pass the cancellation token when reading request response, so in case of large response I can cancel it, not wait till the end. With this change, I suspect that all Receive() extension methods should also accept cancellation token, since they directly use IFlurlResponse methods.

Let me know your thoughts about that.

I guess I just created a duplicate of #711. I'm closing this one.