Avoid Circular Redirect using HttpClient 4.1.1

前端 未结 6 612
花落未央
花落未央 2020-12-10 02:39

How can I avoid circular redirect using HttpClient 4.1.1. As I am getting the error like this:-

executing requestGET http://home.somehost.com/Mynet/pages/cHo         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-10 03:24

    You can set the ClientPNames.ALLOW_CIRCULAR_REDIRECTS to true, this will allow redirects to the same location.

      client.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true); 
    

    See more info here

提交回复
热议问题