Support for custom http client
paiyar opened this issue · 0 comments
paiyar commented
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