code: func (s *QueryService) Query(ctx context.Context, req *query.Request) (flux.ResultIterator, error) {
  	u, err := newURL(s.Addr, queryPath)
  	if err != nil {
  		return nil, err
  	}
  	var body bytes.Buffer
  	if err := json.NewEncoder(&body).Encode(req); err != nil {
  		return nil, err
  	}
  
  	hreq, err := http.NewRequest("POST", u.String(), &body)
  	if err != nil {
  		return nil, err
  	}
  	SetToken(s.Token, hreq)
  	hreq = hreq.WithContext(ctx)
  
  	hc := newClient(u.Scheme, s.InsecureSkipVerify)
  	resp, err := hc.Do(hreq)
  	if err != nil {
  		return nil, err
  	}
  	if err := CheckError(resp, true); err != nil {
  		return nil, err
  	}
  
  	var decoder flux.MultiResultDecoder
  	switch resp.Header.Get("Content-Type") {
  	case "text/csv":
  		fallthrough
  	default:
  		decoder = csv.NewMultiResultDecoder(csv.ResultDecoderConfig{})
  	}
  	results, err := decoder.Decode(resp.Body)
  	if err != nil {
  		return nil, err
  	}
  
  	statResults := &statsResultIterator{
  		results: results,
  		resp:    resp,
  	}
  	return statResults, nil
  }
docs: // Query calls the query route with the requested query and returns a result iterator.