Skip to content

V2.2.0

Compare
Choose a tag to compare
@lygttpod lygttpod released this 03 Mar 07:31
· 18 commits to 2.x since this release

新增缓存时间的配置

                .setHasNetCacheTime(10)//单位秒
                .setNoNetCacheTime(3600)//单位秒

全局请求头设置方式修改,可以实时获取header更新内容

        OkHttpClient okHttpClient = new OkHttpConfig
                .Builder(this)
                //添加公共请求头
                .setHeaders(new BuildHeadersListener() {
                    @Override
                    public Map<String, String> buildHeaders() {
                        HashMap<String, String> hashMap = new HashMap<>();
                        hashMap.put("appVersion", BuildConfig.VERSION_NAME);
                        hashMap.put("client", "android");
                        hashMap.put("token", "your_token");
                        hashMap.put("other_header", URLEncoder.encode("中文需要转码"));
                        return hashMap;
                    }
                })