diff --git a/client/client.go b/client/client.go index fc9171c8ab..456eac20a8 100644 --- a/client/client.go +++ b/client/client.go @@ -283,7 +283,9 @@ func (c *Client) AddHeaders(h map[string][]string) *Client { return c } -// SetHeaders sets multiple header fields and their values in the client. +// SetHeaders method sets multiple headers field and its values at one go in the client instance. +// These headers will be applied to all requests created from this client instance. Also it can be +// overridden at request level headers options. func (c *Client) SetHeaders(h map[string]string) *Client { c.header.SetHeaders(h) return c @@ -301,6 +303,7 @@ func (c *Client) Param(key string) []string { } // AddParam adds a single query parameter and its value to the client. +// These params will be applied to all requests created from this client instance. func (c *Client) AddParam(key, val string) *Client { c.params.Add(key, val) return c diff --git a/client/request.go b/client/request.go index ede9670d62..6c54fe7a6d 100644 --- a/client/request.go +++ b/client/request.go @@ -116,6 +116,7 @@ func (r *Request) Context() context.Context { } // SetContext sets the context for the Request, allowing request cancellation if ctx is done. +// See https://blog.golang.org/context article and the "context" package documentation. func (r *Request) SetContext(ctx context.Context) *Request { r.ctx = ctx return r