So I use apache HttpComponents to handle http request in java.
Now I want to reuse the DefaultHttpClient
, what should be possible accoarding to this example: http:/
This is likely due to a recent bug in the v4.2 BasicClientConnectionManager affecting cross site redirects. See http://issues.apache.org/jira/browse/HTTPCLIENT-1193.
According to the maintainer, one temporary workaround is to use SingleClientConnManager or PoolingClientConnectionManager. Perhaps something like this:
ClientConnectionManager connManager = new PoolingClientConnectionManager();
DefaultHttpClient httpclient = new DefaultHttpClient(connManager);
...