in aliyun-sdk-opensearch/src/main/java/com/aliyun/opensearch/util/HttpClientFactory.java [360:393]
public HttpResult doGet(String url, Map<String, String> headers, String encoding, boolean isPB) throws IOException {
HttpGetRequestResponse httpGetRequestResponse = doGetForHttpGetRequestResponse(url, headers, encoding, isPB);
HttpResponse response = httpGetRequestResponse.getHttpResponse();
HttpGet httpget = httpGetRequestResponse.getHttpGet();
String result = "";
try {
HttpEntity entity = response.getEntity();
if (null != entity) {
try {
result = getGetResponseContent(entity, encoding, isPB);
} finally {
HttpClientUtils.closeQuietly(response);
}
}
} catch (RuntimeException e) {
// 请求失败
this.clientTracer.fail();
throw e;
} catch (IOException e) {
// 请求失败
this.clientTracer.fail();
throw e;
}
// 请求成功
this.clientTracer.success(response, result);
StatusLine statusLine = response.getStatusLine();
List<Header> requestHeaders = Lists.newArrayList(httpget.getAllHeaders());
List<Header> responseHeaders = Lists.newArrayList(response.getAllHeaders());
return new HttpResult(statusLine.getStatusCode(), statusLine.getReasonPhrase(), result, httpget.getURI(),
requestHeaders, responseHeaders);
}