Preventing HttpClient 4 from following redirect

后端 未结 5 1416
礼貌的吻别
礼貌的吻别 2020-12-01 14:19

I\'m connecting to my AppEngine application using the Apache HttpComponents library. In order to authenticate my users, I need to pass an authentication token along to the

5条回答
  •  独厮守ぢ
    2020-12-01 15:01

    With the Version 4.3.x of HttpClient its directly in the clientBuilder.

    so when u build your Client use:

    CloseableHttpClient client = clientBuilder.disableRedirectHandling().build();
    

    I know its an old question but I had this problem too and want to share my solution.

提交回复
热议问题