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

Support for custom http client #89

Open
paiyar opened this issue Feb 12, 2024 · 0 comments
Open

Support for custom http client #89

paiyar opened this issue Feb 12, 2024 · 0 comments

Comments

@paiyar
Copy link

paiyar commented Feb 12, 2024

Summary

Instead of always defaulting to http.DefaultClient, allowing passing one during NewClient configuration

Use cases

This would allow one to specify a custom roundtripper without mutating the http.DefaultClient global variable, this could be useful for adding certificates for custom endpoints that use self-signed certificates or are missing intermediaries.

Proposed solution

Simply allow passing an http client in the New* constructors

Is there a workaround to accomplish this today?

Mutate the global http.DefaultClient which is bad practice and has unintended side-effects for shared code

References & Prior Work

Nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant