List<BasicNameValuePair> formParams = new ArrayList<>();
            formParams.add(new BasicNameValuePair("urlpp", ""));
            formParams.add(new BasicNameValuePair("urlkm", ""));
            formParams.add(new BasicNameValuePair("khjb", "2"));
            HttpEntity httpEntity = new UrlEncodedFormEntity(formParams, "UTF-8");
            HttpPost httpPost = new HttpPost(tesseract.njwztx_baseUrl + "fetchNextList.action");
            httpPost.setEntity(httpEntity);
            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            httpPost.setHeader("X-Requested-With", "XMLHttpRequest");
            httpPost.setHeader("Cookie", "rememberPhone=1; phoneNumber=" + tesseract.getNjwztx_dhhm() + "; friendlyReminder=true;JSESSIONID=" + JSESSIONID + ";");
            HttpClient httpclient = HttpClients.createDefault();
            HttpResponse response = httpclient.execute(httpPost);
            HttpEntity entity = response.getEntity();
            Header[] headers = response.getAllHeaders();
            for (int i = 0; i < headers.length; i++) {
                log.debug("header" + i + ":::" + headers[i]);
            }
            if (entity != null) {
                log.debug("getContentEncoding:::" + entity.getContentEncoding());
                log.debug("getContentType:::" + entity.getContentType());
                String str = EntityUtils.toString(response.getEntity());
                log.debug(str);
                Files.write("2.html", str);
            }

725 total views, 1 views today

发表评论

电子邮件地址不会被公开。 必填项已用*标注