java – HttpProtocolParams. Setuseexpectcontinue (params, false) – when is it set to true?
I'm using org apache. http. impl. client. Defaulthttpclient retrieves XML from WebService and tries to determine whether to set it
HttpProtocolParams.setUseExpectContinue(params,true)
or
HttpProtocolParams.setUseExpectContinue(params,false)
I don't know how to make sure of that Anyone can provide best practice guidelines on when it should be true, when it should be false, and the possible impact of each environment?
Solution
In most cases, it should be false
Expect continue is required only when your request is large (such as file upload) and the server may have authorization requirements You do not want to send large files and get access denied errors So you just need to send the title first. If the server says to continue, you will send the whole request
We encountered some performance problems in the curl based system. We found that 100 continue caused the request to be sent twice It turns out that curl enables 100 continue by default