code: func (c *Client) NewRequest(method, urlString string, body interface{}) (*http.Request, error) {
  
  	url, err := url.Parse(urlString)
  	if err != nil {
  		return nil, err
  	}
  
  	if !url.IsAbs() {
  		url = c.baseURL.ResolveReference(url)
  	}
  
  	var buf io.ReadWriter
  	if body != nil {
  		buf = new(bytes.Buffer)
  		err := json.NewEncoder(buf).Encode(body)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	req, err := http.NewRequest(method, url.String(), buf)
  	if err != nil {
  		return nil, err
  	}
  
  	if c.credentials != nil {
  		req.SetBasicAuth(c.credentials.Username, c.credentials.Password)
  	}
  
  	for k, v := range c.headers {
  		req.Header.Set(k, v)
  	}
  
  	return req, nil
  }
docs: // NewRequest creates a new *http.Request that can be used to execute requests to the
  // server using the client.