hashicorp / go-retryablehttp

Retryable HTTP client in Go
Mozilla Public License 2.0
1.99k stars 251 forks source link

How to use go-retryablehttp with a Client with a custom Transport? #119

Closed tekchain closed 3 years ago

tekchain commented 3 years ago

Dear Hashicorp team,

Is it possible to use go-retryablehttp with a Client with a custom Transport?

Thanks,

Daniel

jefferai commented 3 years ago

Yes -- call NewClient, then replace the embedded http.Client with your client with a custom transport. Please note though that you need to do that before calling other functions on the client, or you can encounter races.