use of com.benmu.framework.extend.adapter.WeexOkhttp3Interceptor in project WeexErosFramework by bmfe.
the class AxiosManager method createClient.
public OkHttpClient createClient(Context context, long timeout) {
CookieJarImpl cookieJar = new CookieJarImpl(new BMPersistentCookieStore(context));
OkHttpClient.Builder builder = new OkHttpClient.Builder().addInterceptor(new LoggerInterceptor("TAG")).connectTimeout(timeout == 0 ? 3000L : timeout, TimeUnit.MILLISECONDS).readTimeout(timeout == 0 ? 30000L : timeout, TimeUnit.MILLISECONDS).cookieJar(cookieJar);
if (DebugableUtil.isDebug()) {
builder.addNetworkInterceptor(new WeexOkhttp3Interceptor());
}
return builder.build();
}
Aggregations