java 代理请求接口 httpclient

 通过httpclient 代理ip和端口访问 接口

        if(StringUtils.isNotBlank(ip)){
            HttpHost proxy  =new HttpHost(ip, port);
            RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
            post.setConfig(config);

 

 

posted @ 2019-11-08 17:38  妖君你好  阅读(213)  评论(0编辑  收藏  举报