use of com.zhy.http.okhttp.cookie.store.PersistentCookieStore in project GzuClassSchedule by mnnyang.
the class app method initOkHttp.
private void initOkHttp() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().followSslRedirects(false).cookieJar(// 为OkHttp设置自动携带Cookie的功能
new LocalCookieJar()).addInterceptor(new LoggerInterceptor("TAG")).cookieJar(// 要在内存Cookie前
new CookieJarImpl(new PersistentCookieStore(getBaseContext()))).cookieJar(// 内存Cookie
new CookieJarImpl(new MemoryCookieStore())).build();
OkHttpUtils.initClient(okHttpClient);
}
Aggregations