You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Karl Wright <da...@gmail.com> on 2014/03/19 11:02:13 UTC

4.3 equivalents of expect-continue parameters

Hi Oleg,

I have 4.2 code which does this:

>>>
params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE,true);
params.setIntParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE,socketTimeout);
<<<

The 4.3 equivalent uses the request configuration object to set the first,
but it's not clear how you set the second.  Any hints?

Thanks
Karl

Re: 4.3 equivalents of expect-continue parameters

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2014-03-19 at 06:02 -0400, Karl Wright wrote:
> Hi Oleg,
> 
> I have 4.2 code which does this:
> 
> >>>
> params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE,true);
> params.setIntParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE,socketTimeout);
> <<<
> 
> The 4.3 equivalent uses the request configuration object to set the first,
> but it's not clear how you set the second.  Any hints?
> 

That should do the trick

---
RequestConfig config = RequestConfig.custom()
        .setExpectContinueEnabled(true)
        .build();
CloseableHttpClient client = HttpClients.custom()
        .setDefaultRequestConfig(config)
        .setRequestExecutor(new HttpRequestExecutor(5000))
        .build();
---

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org