Skip to content

Commit

Permalink
Add custom transport optional function
Browse files Browse the repository at this point in the history
  • Loading branch information
dneto committed Nov 28, 2023
1 parent 710642a commit f5eaf2b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down

0 comments on commit f5eaf2b

Please sign in to comment.