1
2
3
HttpResponse responce = httpClient.execute(httpGet,localContext);
HttpEntity entity = responce.getEntity();
EntityUtils.toString(entity,"UTF-8");
2、通过jsoup解析出token
?
1
2
Document doc = Jsoup.parse(html);
Elements elements =doc.select("input");
最后取出认证成功的cookie
?
1
2
3
4
httpPost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8"));
CloseableHttpResponse response = httpClient.execute(httpPost, localContext);
String postResult = EntityUtils.toString(response.getEntity(), "UTF-8");
List