Https?????Http????????????
???????????? ???????[ 2015/7/22 11:48:25 ] ??????????????? ??????
??????????????????????????????????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();
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11