code: func (c *Client) NewRequest(method, path string, body io.Reader) (*http.Request, error) {
  	req, err := http.NewRequest(method, c.Base+path, body)
  	if err != nil {
  		return nil, err
  	}
  	switch {
  	case c.useBearerAuth && c.Token != "":
  		req.Header.Add("Authorization", "Bearer "+c.Token)
  	case !c.useBearerAuth && (c.ID != "" || c.Token != ""):
  		req.SetBasicAuth(c.ID, c.Token)
  	}
  	req.Header.Add("User-Agent", ua)
  	req.Header.Add("Accept", "application/json")
  	req.Header.Add("Accept-Charset", "utf-8")
  	if method == "POST" || method == "PUT" {
  		uploadType := c.UploadType
  		if uploadType == "" {
  			uploadType = JSON
  		}
  		req.Header.Add("Content-Type", fmt.Sprintf("%s; charset=utf-8", uploadType))
  	}
  	return req, nil
  }
docs: // NewRequest creates a new Request and sets basic auth based on the client's
  // authentication information.