> How would I swap out a http.Client that is required by a third-party library with a another that supports, say retries with exponential back-off? I'd suggest looking at http.Transport and http.RoundTripper [ https://golang.org/pkg/net/http/#RoundTripper]. The docs explicitly forbid using RoundTripper to implement higher level protocol features like retry-with-backoff based on HTTP response codes, but those are your only hooks into making this a feature of the client rather than moving the retry logic somewhere else.
On Sun, Dec 11, 2016 at 4:07 AM <omarshariffdontlik...@gmail.com> wrote: > Just a quick question - I've noticed that the http package doesn't have an > interface for Client. How would I swap out a http.Client that is required > by a third-party library with a another that supports, say retries with > exponential back-off? It appears that it is not possible? Would the http > package benefit from an interface for the http.Client? > > Cheers! > Ben > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.