hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arul Dhesiaseelan <ar...@acm.org>
Subject Re: Request Redirect in 4.3.x
Date Sun, 10 Nov 2013 06:51:15 GMT
Nevermind, I see the RequestBuilder which has an API to set the redirects
on the RequestConfig.

requestBuilder.setConfig(RequestConfig.custom().setRedirectsEnabled(false).build());
requestBuilder.setEntity(entity);
requestBuilder.build()

- Arul

On Sat, Nov 9, 2013 at 4:58 PM, Arul Dhesiaseelan <aruld@acm.org> wrote:

> Hi,
>
> I have this code using 4.2.x APIs for controlling redirect at the request.
>
>
> request.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS,
> false);
>
> This allows me to configure redirect per-request, instead of the global
> redirect client config.
>
> How do I implement this in 4.3.x as getParams() is deprecated?
>
> I have this code for the client:
>
>         requestConfigBuilder.setRedirectsEnabled(true);
>         RequestConfig requestConfig = requestConfigBuilder.build();
>         clientBuilder.setDefaultRequestConfig(requestConfig);
>         clientBuilder.build();
>
> I would like to override redirects at the request. Is this possible with
> the new APIs?
>
> Thanks,
> Arul
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message