From f5eaf2bf2260fc775ad5e6f0a8530736ee582459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dem=C3=A9trio=20Menezes=20Neto?= Date: Tue, 28 Nov 2023 13:01:03 +0000 Subject: [PATCH] Add custom transport optional function --- httpclient.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/httpclient.go b/httpclient.go index 09f5627..3672648 100644 --- a/httpclient.go +++ b/httpclient.go @@ -112,6 +112,14 @@ func WithDefaultTransport(transportTimeout time.Duration) func(*HTTPClient) { } } +// WithTransport configures the client to use a custom *http.Transport +// More information about transport: [net/http.Transport] +func WithTransport(transport *http.Transport) func(*HTTPClient) { + return func(client *HTTPClient) { + client.setTransport(transport) + } +} + // WithOAUTHTransport allows the client to make OAuth HTTP requests with custom timeout. // This timeout limits the time spent establishing a TCP connection. //