Pathoschild / FluentHttpClient

A modern async HTTP client for REST APIs. Its fluent interface lets you send an HTTP request and parse the response in one go.
MIT License
342 stars 52 forks source link

Add option to indicate that we want the response to be streamed #124

Closed Jericho closed 4 months ago

Jericho commented 4 months ago

Resolves #123

Pathoschild commented 4 months ago

Thanks! I assume the underlying client uses an enum to allow for more values in the future. While the bool streamResponse option is simpler, should we expose the enum instead to match the base client (since it's meant to be a thin wrapper)?

For example, it would look something like this:

IResponse response = await client
    .GetAsync("endpoint")
    .WithOptions(completeWhen: HttpCompletionOption.ResponseHeadersRead);
Jericho commented 4 months ago

No objection. Pushing an update with these changes in a few minutes...

Pathoschild commented 4 months ago

Merged into develop for the upcoming FluentHttpClient 4.4.0. Thanks for the help!