0
使用HTTP組件HTTPClient 4項目來處理HTTP GET方法的最佳方式是什麼? 什麼是參數化認證信息的最佳途徑?屬性文件?重新加載方法到守護程序服務?帶有https的HTTP客戶機
HttpClient httpClient = new DefaultHttpClient();
String url = "https://xxx.190.2.45/index.jsp";
HttpGet get = new HttpGet(url);
try {
//TODO
HTTPHelper.addSSLSupport(httpClient);
HttpResponse response = httpClient.execute(get);
BasicResponseHandler responseHandler = new BasicResponseHandler();
String responseString = responseHandler.handleResponse(response);
} catch (ClientProtocolException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}