本文整理匯總了Java中com.lzy.okgo.cookie.store.CookieStore類的典型用法代碼示例。如果您正苦於以下問題:Java CookieStore類的具體用法?Java CookieStore怎麽用?Java CookieStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CookieStore類屬於com.lzy.okgo.cookie.store包,在下文中一共展示了CookieStore類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCookie
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
@OnClick(R.id.getCookie)
public void getCookie(View view) {
//一般手動取出cookie的目的隻是交給 webview 等等,非必要情況不要自己操作
CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
HttpUrl httpUrl = HttpUrl.parse(Urls.URL_METHOD);
List<Cookie> cookies = cookieStore.getCookie(httpUrl);
showToast(httpUrl.host() + "對應的cookie如下:" + cookies.toString());
}
示例2: getAllCookie
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
@OnClick(R.id.getAllCookie)
public void getAllCookie(View view) {
//一般手動取出cookie的目的隻是交給 webview 等等,非必要情況不要自己操作
CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
List<Cookie> allCookie = cookieStore.getAllCookie();
showToast("所有cookie如下:" + allCookie.toString());
}
示例3: removeCookie
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
@OnClick(R.id.removeCookie)
public void removeCookie(View view) {
HttpUrl httpUrl = HttpUrl.parse(Urls.URL_METHOD);
CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
cookieStore.removeCookie(httpUrl);
showToast("詳細移除cookie的代碼,請看demo的代碼");
}
示例4: CookieJarImpl
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
public CookieJarImpl(CookieStore cookieStore) {
if (cookieStore == null) {
throw new IllegalArgumentException("cookieStore can not be null!");
}
this.cookieStore = cookieStore;
}
示例5: getCookieStore
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
public CookieStore getCookieStore() {
return cookieStore;
}
示例6: setCookieStore
import com.lzy.okgo.cookie.store.CookieStore; //導入依賴的package包/類
/** 全局cookie存取規則 */
public OkGo setCookieStore(CookieStore cookieStore) {
cookieJar = new CookieJarImpl(cookieStore);
okHttpClientBuilder.cookieJar(cookieJar);
return this;
}