jeasonlzy / okhttp-OkGo

OkGo - 3.0 震撼来袭,该库是基于 Http 协议,封装了 OkHttp 的网络请求框架,比 Retrofit 更简单易用,支持 RxJava,RxJava2,支持自定义缓存,支持批量断点下载管理和批量上传管理功能
Apache License 2.0
10.59k stars 2.55k forks source link

同步请求不能缓存? #623

Open tmxd09887 opened 6 years ago

tmxd09887 commented 6 years ago

okhttp3.Response response = OkGo.get(testUrl)// .tag(this)// .cacheMode(CacheMode.FIRST_CACHE_THEN_REQUEST) .cacheKey(testUrl) .cacheTime(3600 * 3) .execute();

List<CacheEntity<?>> all = CacheManager.getInstance().getAll();

查了缓存不存在

谢谢

tmxd09887 commented 6 years ago

还有一个问题,这种同步方式下不能捕捉错误信息吗?如果出错了,能否打印出错误信息。

比如onerror