if (proxyServer.getPrincipal() != null) {
Credentials defaultcreds = new UsernamePasswordCredentials(proxyServer.getPrincipal(), proxyServer.getPassword());
client.getState().setCredentials(new AuthScope(null, -1, AuthScope.ANY_REALM), defaultcreds);
}
ProxyHost proxyHost = proxyServer == null ? null : new ProxyHost(proxyServer.getHost(), proxyServer.getPort());
client.getHostConfiguration().setProxyHost(proxyHost);
}
method.setFollowRedirects(false);
if ((request.getCookies() != null) && !request.getCookies().isEmpty()) {