Code example for HttpRequest

Methods: getRequestLine

0
 */ 
public class GermantechDefaultRedirectStrategy extends DefaultRedirectStrategy { 
	@Override 
	public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException {
		// Se for um 302 e método POST, redireciona, caso contrário, retorna o super 
		if(response.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY && request.getRequestLine().getMethod().equalsIgnoreCase(HttpPost.METHOD_NAME))
			return true; 
		else 
			return super.isRedirected(request, response, context);
	} 
}