Apache commonsのHttpClientで、パスワード認証が必要なプロキシサーバを使うサンプル

  1. HttpClient httpclient = new HttpClient();
  2. httpclient.getHostConfiguration().setProxy("test.proxy.co.jp", 8080);
  3. httpclient.getState().setProxyCredentials(new AuthScope("test.proxy.co.jp", 8080), new UsernamePasswordCredentials("testUser", "password"));

戻る