爬虫四式——HttpClient

CircularRedirectException异常原因及解决办法

 

【解决办法】

HttpParams params = new BasicHttpParams(); 
HttpGet getMethod = new HttpGet("http://XXXX.XXX");
getMethod.getParams().setParameter("http.protocol.allow-circular-redirects", true);
HttpResponse response = httpClient.execute(getMethod);

参考:HttpClient的CircularRedirectException异常原因及解决办法

你可能感兴趣的:(爬虫四式——HttpClient)