Java Code Examples for org.apache.http.impl.client.DefaultHttpClient.setRedirectStrategy()

The following are Jave code examples for showing how to use setRedirectStrategy() of the org.apache.http.impl.client.DefaultHttpClient class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Equella   File: HttpServiceImpl.java   Source Code and License Vote up 5 votes
private DefaultHttpClient createClient(boolean https)
{
	final DefaultHttpClient client = (https ? new DefaultHttpClient(conMan) : new DefaultHttpClient());
	// Allows a slightly lenient cookie acceptance
	client.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
	// Allows follow of redirects on POST
	client.setRedirectStrategy(new LaxRedirectStrategy());
	return client;
}