code: func (cli *OpsGenieClient) sendRequest(req goreq.Request) (*goreq.Response, error) {
  	// send the request
  	var resp *goreq.Response
  	var err error
  	for i := 0; i < cli.httpTransportSettings.MaxRetryAttempts; i++ {
  		resp, err = req.Do()
  		if err == nil && resp.StatusCode < 500 {
  			break
  		}
  		if resp != nil {
  			defer resp.Body.Close()
  			logging.Logger().Info(fmt.Sprintf("Retrying request [%s] ResponseCode:[%d]. RetryCount: %d", req.Uri, resp.StatusCode, (i + 1)))
  		} else {
  			logging.Logger().Info(fmt.Sprintf("Retrying request [%s] Reason:[%s]. RetryCount: %d", req.Uri, err.Error(), (i + 1)))
  		}
  		time.Sleep(timeSleepBetweenRequests * time.Duration(i+1))
  	}
  	if err != nil {
  		message := "Unable to send the request " + err.Error()
  		logging.Logger().Warn(message)
  		return nil, errors.New(message)
  	}
  	// check for the returning http status
  	statusCode := resp.StatusCode
  	if statusCode >= 400 {
  		body, err := resp.Body.ToString()
  		if err != nil {
  			message := "Server response with error can not be parsed " + err.Error()
  			logging.Logger().Warn(message)
  			return nil, errors.New(message)
  		}
  		return nil, errorMessage(statusCode, body)
  	}
  	return resp, nil
  }
docs: // sendRequest is an internal method to send the prepared requests to OpsGenie.