code: func (rt *DefaultRequestDoer) NewRequest(method, path string,
  	query *url.Values, body interface{}) (*http.Request, error) {
  
  	b := &bytes.Buffer{}
  	if body != nil {
  		enc := json.NewEncoder(b)
  		err := enc.Encode(body)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	if query == nil {
  		query = &url.Values{}
  	}
  
  	if q := query.Encode(); q != "" {
  		path += "?" + q
  	}
  
  	req, err := http.NewRequest(method, rt.Host+path, b)
  	if err != nil {
  		return nil, err
  	}
  
  	req.Header.Set("Host", rt.Host)
  
  	if body != nil {
  		req.Header.Set("Content-type", "application/json")
  	}
  
  	return req, nil
  }
docs: // NewRequest constructs a new http.Request, with a body containing the json
  // representation of body, if provided.