docs: public HttpResponse invoke(String uri, String payload, HttpMethod method) {
          HttpResponse result = null;
          String url = directoryAddresses + uri;
          try {
              if (method == null || method == HttpMethod.GET) {
                  result = HttpUtils.getJson(url);
              } else if (method == HttpMethod.POST) {
                  result = HttpUtils.postJson(url, payload);
              } else if (method == HttpMethod.PUT) {
                  result = HttpUtils.putJson(url, payload);
              } else if (method == HttpMethod.DELETE) {
                  result = HttpUtils.deleteJson(url);
              }
          } catch (IOException e) {
              String errMsg = "Send HTTP Request to remote Directory Server failed";
              LOGGER.error(errMsg);
              LOGGER.debug(errMsg, e);
              ServiceDirectoryError sde = new ServiceDirectoryError(ErrorCode.HTTP_CLIENT_ERROR);
              throw new ServiceException(sde, errMsg, e);
          }
  
          if (result.getHttpCode() < 200 || result.getHttpCode() >= 300) {
              String errorBody = result.getRetBody();
  
              if(errorBody == null || errorBody.isEmpty()){
                  LOGGER.error("Invoke remote directory server failed, status=" + result.getHttpCode()
                          + ", Error Message body is empty.");
                  ServiceDirectoryError sde = new ServiceDirectoryError(
                          ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR);
                  throw new ServiceException(sde, "Error Message body is empty.");
              }
              ServiceDirectoryError sde = null;
              try {
                  sde = (ServiceDirectoryError) serializer
                          .deserialize(errorBody.getBytes(),
                                  ServiceDirectoryError.class);
              } catch (IOException  e) {
                  String errMsg = "Deserialize error body message failed";
                  LOGGER.error(errMsg);
                  LOGGER.debug(errMsg + ", messageBody=" + errorBody, e);
                  ServiceDirectoryError sde1 = new ServiceDirectoryError(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR);
                  throw new ServiceException(sde1, errMsg, e);
              }
  
              if (sde != null) {
                  throw new ServiceException(sde);
              }
          }
          return result;
      }