HttpProtocolParams.setUseExpectContinue (params, false) - when to set true?

I am using org.apache.http.impl.client.DefaultHttpClient to fetch xml from a web service and trying to determine if to install

 HttpProtocolParams.setUseExpectContinue(params, true) 

or

 HttpProtocolParams.setUseExpectContinue(params, false) 

I do not understand how to determine this. Can someone offer recommendations on best practices when this should be true and when it should be false, as well as the possible consequences of each setting?

+6
source share
1 answer

In most cases, it should be false.

Waiting-continuation is necessary only when your request is large (for example, downloading a file), and the server may have an authorization request. You do not want to send a huge file and receive the "Access denied" error message. This way you just send the headers first, and if the server says continue, you will send the entire request.

We had a performance problem with a Curl-based system, and we found out that 100-Continue causes the request to be sent twice. Turns out Curl has a 100-Continue by default.

+8
source

All Articles