code: private static String buildUrl(String host, String path, String param) {
          try {
              StringBuilder sbUrl = new StringBuilder();
              sbUrl.append(host);
              if (StringUtil.isNotEmpty(path)) {
                  sbUrl.append(path);
              }
              if (StringUtil.isNotEmpty(param)) {
                  StringBuilder sbParam = new StringBuilder();
                  sbParam.append(URLEncoder.encode(param, Charset.UTF_8));
                  if (0 < sbParam.length()) {
                      sbUrl.append("?").append(sbParam);
                  }
              }
  
              return sbUrl.toString();
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          }
          return null;
      }
docs: Build URL
  @param host 服务器
  @param path 虚拟站点
  @param param 参数
  @return 拼接后的URL