HttpContext localContext = new BasicHttpContext();
AuthSchemeBase authScheme = new BasicScheme();
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
CloseableHttpAsyncClient httpAsyncClient = HttpAsyncClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
httpAsyncClient.start();

Future<HttpResponse> future = httpAsyncClient.execute(request, localContext, null);
HttpResponse response = future.get();
if (response != null) {
StatusLine statusLine = response.getStatusLine();
if (statusLine != null) {
logger.warn(requestURL + " " + statusLine.toString());
if (statusLine.getStatusCode() == HttpStatus.SC_OK) {
byte[] bytes = EntityUtils.toByteArray(response.getEntity());
return new String(bytes, WeiboConstants.CHARSET_UTF8);
}
}
}