以前,我在httpclient3從HttpClient的轉換3至HttpClient的4(Cookie政策)
// 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);
什麼是錯誤? – kosa
更新了錯誤信息。 –
看來你有案件問題的問題。 httpclient應該是httpClient。 – kosa