HttpClient4.3.6 中可以如下设置代理:
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
CloseableHttpClient httpClient = HttpClients.custom().setRoutePlanner(routePlanner).build();
对于RESTFUL框架restlet中,客户端调用如下:
ClientResource client = new ClientResource(url + "student/add");
String result = client.get().getText();
现在因为公司内网调外网接口需要代理做跳转
,请问客户端请求中能否设置代理,如何设置?