Skip to content

Commit

Permalink
feat: add NewWithDialerAndTimeout method #795
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Aug 4, 2024
1 parent a053a8a commit e6db160
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resty.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,17 @@ func NewWithClient(hc *http.Client) *Client {
//
// Since v3.0.0
func NewWithDialer(dialer *net.Dialer) *Client {
return NewWithDialerAndTimeout(dialer, defaultClientTimeout)
}

// NewWithDialer method creates a new Resty client with given Local Address
// to dial from.
//
// Since v3.0.0
func NewWithDialerAndTimeout(dialer *net.Dialer, timeoutSetting *ClientTimeoutSetting) *Client {
return createClient(&http.Client{
Jar: createCookieJar(),
Transport: createTransport(dialer, defaultClientTimeout),
Transport: createTransport(dialer, timeoutSetting),
})
}

Expand Down

0 comments on commit e6db160

Please sign in to comment.