code: private static void sendRequest(String url, byte[] body, String publicKey, ICheckLoginSignHandler callback) {
          HttpURLConnection conn = null;
  
          OutputStream out = null;
          InputStream is = null;
          InputStreamReader isr = null;
          try {
              URL urlReq = new URL(url);
              conn = (HttpURLConnection)urlReq.openConnection();
  
              // 设置HttpURLConnection选项
              conn.setRequestMethod("POST");
              conn.setConnectTimeout(CONN_TIMEOUT);
              conn.setReadTimeout(READ_TIMEOUT);
              conn.setUseCaches(false);
              conn.setDoOutput(true);
              conn.setRequestProperty("Content-Type", "application/json");
              conn.setFixedLengthStreamingMode(body.length);
  
              // 写入body数据
              out = conn.getOutputStream();
              out.write(body);
              out.flush();
  
              int httpCode = conn.getResponseCode();
              if (httpCode == HttpURLConnection.HTTP_OK)
              {
                  StringBuilder sb = new StringBuilder();
                  char[] buffer = new char[512];
                  is = conn.getInputStream();
                  isr = new InputStreamReader(is, "UTF-8");
                  int readLen = 0;
                  while ((readLen = isr.read(buffer)) != -1) {
                      sb.append(buffer, 0, readLen);
                  }
  
                  // 资源释放
                  close(out);
                  out = null;
                  close(is);
                  is = null;
                  close(isr);
                  isr = null;
  
                  // 调用子类解析函数
                  String str = sb.toString();
                  if (!TextUtils.isEmpty(str)) {
                      callbackResult(str, publicKey, callback);
                  } else {
                      callback.onCheckResult(null, "response string is empty!", false);
                  }
              } else {
                  // 资源释放
                  close(out);
                  out = null;
                  callback.onCheckResult(null, "http request code is " + httpCode, false);
              }
          }catch (Exception e) {
              // 资源释放
              close(out);
              close(is);
              close(isr);
  
              callback.onCheckResult(null, "http request exception:" + e.getMessage(), false);
          }
      }
docs: 发送验签请求
  @param url 请求url
  @param body 请求body
  @param publicKey 验签所使用的公钥
  @param callback 验签结果回调