以前,我在httpclient3中有以下代码
// To prevent cookie warnings.
httpClient.getParams().setParameter("http.protocol.single-cookie-header", true);
httpClient.getParams().setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.BROWSER_COMPATIBILITY);
我想知道,httpclient4 中的等效代码是什么,因为我在第二行遇到错误。
// To prevent cookie warnings.
httpClient.getParams().setParameter("http.protocol.single-cookie-header", true);
// ??? compilation error in this line.
// org.apache.commons.httpclient cannot be resolved to a variable
httpClient.getParams().setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.BROWSER_COMPATIBILITY);