Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Named HttpClients with Refit.HttpClientFactory #1909

Closed
derekm opened this issue Nov 4, 2024 · 1 comment · Fixed by #1910
Closed

Using Named HttpClients with Refit.HttpClientFactory #1909

derekm opened this issue Nov 4, 2024 · 1 comment · Fixed by #1910

Comments

@derekm
Copy link
Contributor

derekm commented Nov 4, 2024

Is your feature request related to a problem? Please describe.
We want to reuse Named Clients with Refit, mostly to inherit common configuration.

Documentation of AddRefitClient is unclear as to whether previously named clients will be picked up or clobbered.

Describe the solution you'd like
We'd like service collection extensions AddRefitClient to pick up previously configured named clients.

Describe alternatives you've considered
Writing our own possibly-unnecessary version of the AddRefitClient service collection extension.

Describe suggestions on how to achieve the feature
Test that the desired behavior is the present behavior and leave tests behind so this behavior doesn't change.

Additional context
AddRefitClient's client name will pick up a previously configured named client, but since AddRefitClient returns IHttpClientBuilder, you can reconfigure the underlying IHttpClientFactory as described in #1686 while expecting to modify separate clients instead of a shared configurator, builder or factory.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant