code: func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) {
  	// Build URL for request
  	u, err := c.buildURLForRequest(urlStr)
  	if err != nil {
  		return nil, err
  	}
  
  	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, u, buf)
  	if err != nil {
  		return nil, err
  	}
  
  	// Apply Authentication
  	if err := c.addAuthentication(req); err != nil {
  		return nil, err
  	}
  
  	// Request compact JSON
  	// See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output
  	req.Header.Add("Accept", "application/json")
  	req.Header.Add("Content-Type", "application/json")
  
  	// TODO: Add gzip encoding
  	// Accept-Encoding request header is set to gzip
  	// See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output
  
  	return req, nil
  }
docs: // NewRequest creates an API request.
  // A relative URL can be provided in urlStr, in which case it is resolved relative to the baseURL of the Client.
  // Relative URLs should always be specified without a preceding slash.
  // If specified, the value pointed to by body is JSON encoded and included as the request body.