diff --git a/api2captcha.go b/api2captcha.go index 89fb58f..58dc293 100644 --- a/api2captcha.go +++ b/api2captcha.go @@ -226,7 +226,7 @@ func NewClient(apiKey string) *Client { DefaultTimeout: 120, PollingInterval: 10, RecaptchaTimeout: 600, - httpClient: &http.Client{}, + httpClient: http.DefaultClient, } } @@ -259,7 +259,7 @@ func (c *Client) res(req Request) (*string, error) { uri.RawQuery = values.Encode() var err error = nil - resp, err = http.Get(uri.String()) + resp, err = c.httpClient.Get(uri.String()) if err != nil { return nil, ErrNetwork } @@ -347,7 +347,7 @@ func (c *Client) Send(req Request) (string, error) { } var err error = nil - resp, err = http.PostForm(uri.String(), values) + resp, err = c.httpClient.PostForm(uri.String(), values) if err != nil { return "", ErrNetwork }