Hello Everybody !
I have a problem regarding HTTPClient when I do a POST. In some
situations, the code returned is 100 - Continue.
What should I do ? I don't know what to do.
byte[] message = ...;
HttpClient hc = new HttpClient();
PostMethod pm = new PostMethod('"...url... ");
hc.getHostConfiguration().setProxy("proxyHost",123);
Credentials cr = new UsernamePasswordCredentials("xx","xx");
hc.getState().setProxyCredentials(null,cr);
pm.setDoAuthentication(true);
pm.setRequestHeader("Cache-Control","no-store"); //HTTP 1.1
pm.setRequestHeader("Pragma","no-cache"); //HTTP 1.0
pm.setRequestHeader("Content-type","text/xml");
pm.setRequestBody(new ByteArrayInputStream(message));
// Must set length to -1 to use Chunked. (BUG when content-length is
0).
int len = (message.length == 0) ? -1 : message.length;
pm.setRequestContentLength(len);
int rc = hc.executeMethod(pm);
// The rc == 100
if (rc == 200) {
contents = pm.getResponseBody();
}