How to prevent apache http client from following a redirect

后端 未结 10 1887
独厮守ぢ
独厮守ぢ 2020-11-28 06:08

I\'m connecting to a remote server with apache http client. the remote server sends a redirect, and i want to achieve that my client isn\'t following the redirect automatica

10条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 06:35

    this worked for me CloseableHttpClient client = HttpClientBuilder.create().disableRedirectHandling().build()

提交回复
热议问题