The standard library doesn't support features like Retry of error and different backoff strategies for the same. The recommended approach is to wrap the standard library HTTP client package with any custom handling logic. (See ianlancetaylor's reponse in golang/go#16047)
I propose adding an HTTPClient interface with the same method signatures as the standard library HTTP Client
type Client
func (c *Client) CloseIdleConnections()
func (c *Client) Do(req *Request) (*Response, error)
func (c *Client) Get(url string) (resp *Response, err error)
func (c *Client) Head(url string) (resp *Response, err error)
func (c *Client) Post(url, contentType string, body io.Reader) (resp *Response, err error)
func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error)
Added a PR for the same #86
Please let me know if this makes sense and can be supported. Would really benefit our team in adding retry mechanism to the client for all requests.
The standard library doesn't support features like Retry of error and different backoff strategies for the same. The recommended approach is to wrap the standard library HTTP client package with any custom handling logic. (See ianlancetaylor's reponse in golang/go#16047)
I propose adding an HTTPClient interface with the same method signatures as the standard library HTTP Client
Added a PR for the same #86
Please let me know if this makes sense and can be supported. Would really benefit our team in adding retry mechanism to the client for all requests.