code: private String urlEncode(String str) {
          try {
              return URLEncoder.encode(str, LettuceCharsets.UTF8.name()).replaceAll("%2F", "/");
          } catch (UnsupportedEncodingException e) {
              throw new IllegalStateException(e);
          }
      }
docs: URL encode the {@code str} without slash escaping {@code %2F}
  
  @param str
  @return the URL-encoded string