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

Accept an interface instead of *http.Client in WithHTTPClient #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arthurdarcet
Copy link

The WithHTTPClient helper is not really useful if you have to return a real *http.Client. Using an interface here allows us to create custom implementations that can intercept the request and whatever we need with it (such as adding headers)

(adding headers is technically feasible by using a custom Transport wrapped in a real http.Client, but that's not really recommended)

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

Successfully merging this pull request may close these issues.

1 participant