??????????????????????????????????web???????????????ssl???????????????????????????http?????
?????????????web?????????????????????????????????????????ssl?????????????????????
??????????????????????????:
????????web???(http??): http://***.com/
?????????ssl????: https://login.***.com;
?????????http: http://***.com/common/getInfo.do?***;
????????н????????????????
????????????
??????????http????????????????????Httpclient?з???????н??????
????inputurl="http://***.com/common/getEmployeeByDept.do?dept1=D032&dept2=D032002&dept3=D032010"
????//????HttpClientBuilder
????HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
????//HttpClient
????CloseableHttpClient httpClient = httpClientBuilder.build();
????HttpGet httpGet = new HttpGet(inputurl);
??????????????£?
????{"code":"400"??"data":null??"msg":"?????μ????"}
??????????????????????????С???????????С?
????????????????????????Http>Https>Http??????У?session????????????????????????http?????????????????????????????httpsЭ???£??????????????????????????????????session??????????????. ?????????????????session????????
??????session??????????cookie???????????????????????????????????????????cookie??????????cookie??key??JSESSIONID??value??session??id??????????????????cookie??
?????????
???????????
???????????Httpclient???cookie?? ???????http??????????????????(https://login.***.com/accounts/login/?uid=523f70387b3d42439905170931f34a65&next=/openid/%3Fopenid.ns%3Dhttp%253A%252F%252Fspecs.openid.net%252Fauth%252F2.0%26openid.claimed_id%.........????????仯????????????????
HttpHost httpHost = new HttpHost("localhost");
HttpGet httpGet = new HttpGet("/https/");
HttpResponse response = httpClient.execute(httpHost??httpGet);
if(HttpStatus.SC_OK==response.getStatusLine().getStatusCode()){
HttpEntity entity = response.getEntity();
}
httpGet = new HttpGet("/https/index.jsp?cookie=write");
response = httpClient.execute(httpHost??httpGet);
FileWriter fw = new FileWriter("C:/cookie.txt");
//???cookie?????????
List<Cookie> cookies = ((AbstractHttpClient) httpClient).getCookieStore().getCookies();