I am trying to update code from Apache HTTP client 3.1 to 4.5 and I have several methods like client.getHostConfiguration
, client.getState
,client.getHttpConnectionManager
. All of these do not work in the newer versions of httpclient so I am wondering how to rewrite these. All I see in the HTTP client documentation is getParams. But I don't know how to get allthis other info from that.
If anyone wants the context that these are being used in
if(getProxy() != null) {
client.getHostConfiguration().setProxy(getProxy().getHost(),getProxy().getPort());
if (HttpProxyCredentials.isProxySet()) {
AuthScope authScope = new AuthScope(getProxy().getHost(), getProxy().getPort());
client.getState().setProxyCredentials(authScope, new NTCredentials(HttpProxyCredentials.getUserName(),
HttpProxyCredentials.getPassword(),
"",HttpProxyCredentials.getDomain()));
Here's a modern proxy example for builing a Method: