1
我想從Apache HTTP客戶端3.1更新代碼到4.5,我有幾種方法,如client.getHostConfiguration
,。所有這些都不適用於新版本的httpclient,所以我想知道如何重寫這些。我在HTTP客戶端文檔中看到的所有內容都是getParams。但我不知道如何從中得到所有這些信息。使用HTTP客戶端的Java 4.5客戶端獲取語句
如果有人想,這些都是在
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()));