#Java8でproxy経由
HttpReq.java
HttpHost proxy = new HttpHost(Host, port);
RequestConfig requestConfig = RequestConfig.custom().setProxy(proxy).build();
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(host, port), new UsernamePasswordCredentials(userID,passwd));
HttpClient httpClient = HttpClientBuilder.create()
.setDefaultRequestConfig(requestConfig)
.setDefaultCredentialsProvider(credsProvider)
.build();
String urlString = URL;
HttpPost post = new HttpPost(urlString);
post.setHeader("Content-Type", "text/html; charset=Shift_JIS");
final HttpResponse res = httpClient.execute(post);
HttpEntity httpEntity = res.getEntity();
log.debug("HTTP_REQ=>" + EntityUtils.toString(httpEntity));
こんな感じで長すぎワロタ
もっと短くできそうだと思うんだけどね…
Diff10/21
直したら綺麗になった!キータちゃんすごす