|
|
@ -105,6 +105,7 @@ public class HttpsUtils { |
|
|
|
apiUrl += param; |
|
|
|
apiUrl += param; |
|
|
|
String result = null; |
|
|
|
String result = null; |
|
|
|
HttpClient httpClient = null; |
|
|
|
HttpClient httpClient = null; |
|
|
|
|
|
|
|
HttpResponse response = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
if (apiUrl.startsWith("https")) { |
|
|
|
if (apiUrl.startsWith("https")) { |
|
|
@ -115,7 +116,7 @@ public class HttpsUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HttpGet httpGet = new HttpGet(apiUrl); |
|
|
|
HttpGet httpGet = new HttpGet(apiUrl); |
|
|
|
HttpResponse response = httpClient.execute(httpGet); |
|
|
|
response = httpClient.execute(httpGet); |
|
|
|
HttpEntity entity = response.getEntity(); |
|
|
|
HttpEntity entity = response.getEntity(); |
|
|
|
if (entity != null) { |
|
|
|
if (entity != null) { |
|
|
|
InputStream instream = entity.getContent(); |
|
|
|
InputStream instream = entity.getContent(); |
|
|
@ -126,6 +127,13 @@ public class HttpsUtils { |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(e.getMessage(),e); |
|
|
|
log.error(e.getMessage(),e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
|
|
|
|
if (response != null) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
EntityUtils.consume(response.getEntity()); |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
|
|
log.error(e.getMessage(),e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|