public String doSingleLink(String url, String loginsuccess, String jsTxt,String email,String pwd)
            throws IOException {
        // 读取登录页面内容
        URL serviceIpUrl = new URL(url);
        URLConnection connection = serviceIpUrl.openConnection();
        connection.setRequestProperty("method", "post");
        connection.connect();
        InputStreamReader isr = null;
        BufferedReader br = null;
        String loginTxt = "";
        InputStream is = connection.getInputStream();
        is = connection.getInputStream();
        isr = new InputStreamReader(is,"utf-8");
        br = new BufferedReader(isr);
        String str = "";
        try {
            while ((str = br.readLine()) != null) {
                loginTxt += str + "\r\n";
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        br.close();
        is.close();
        return loginTxt;
    }

简单记下。

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2021-07-06
  • 2021-12-17
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2021-06-09
  • 2021-08-16
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案