Whey HttpState only has addCookie/purgeExpiredCookies method, but no
purgeAllCookies mothod ?
How to remove all cookies in the code ?
HostConfiguration config = new HostConfiguration();
config.setProxy(record.host, record.port);
HttpConnectionManagerParams hcp = new HttpConnectionManagerParams();
hcp.setConnectionTimeout(TIMEOUT_CONNECT);
hcp.setSoTimeout(TIMEOUT_READ);
SimpleHttpConnectionManager hcm = new SimpleHttpConnectionManager();
hcm.setParams(hcp);
HttpClient hc = new HttpClient();
hc.setHostConfiguration(config);
hc.setHttpConnectionManager(hcm);
HttpMethod method = new GetMethod(url);
int statusCode = hc.executeMethod(config, method, new HttpState());
if (statusCode != 200) {
throw new ConnectException("GET '" + url + "' fail");
}
InputStream is = method.getResponseBodyAsStream();
if (is == null) {
throw new IOException("No response body");
}
int nb = 0, rb = 0;
byte[] buf = new byte[65536];
while ((rb = is.read(buf)) >= 0) {
nb += rb;
}
is.close();
method.releaseConnection();
hcm.closeIdleConnections(0);
Thanks for some help
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]