I am using Httpclient to get the web page content,when we specify below urls
like

http://www.milwaukeetool.com/power-tools#product+Types=Diamond+Coring
it will be redirected to 
http://www.milwaukeetool.com/power-tools?product+Types=Diamond+Coring

and 

http://blackwoods.com.au/browse/flat-cut-off-wheels-metal-flexovit/302022874
it will be redirected to
http://blackwoods.com.au/search/flat-cut-off-wheels-metal-flexovit/302022874

and giving invalid page content.

So, I am looking for a solution to handle rediection to get correct page
content using HttpClient.
Below is the code which I am using to handle redirection using httpclient..

HttpGet httpGet = new HttpGet(UrlRequest);
httpclient = HttpClientBuilder.create().setRedirectStrategy(new
LaxRedirectStrategy()).build();
HttpResponse  response = httpclient.execute(httpGet);
HttpEntity entity = response.getEntity(); 
thirdPartyPageContent=EntityUtils.toString(entity);




--
View this message in context: 
http://httpcomponents.10934.n7.nabble.com/Handling-Url-s-redirection-using-Httpclient-tp25485.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to