本文整理汇总了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;
}