在OkHttp 2.6 下,
public Builder cacheControl(CacheControl cacheControl) {
String value = cacheControl.toString();
if (value.isEmpty()) return removeHeader("Cache-Control");
return header("Cache-Control", value);
}
设置了策略会覆盖头字段的,所以头字段写缓存字段 没必要。
然后在OkHttp 3.0下
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
用最新的引用,cacheControl无效,我研究了一下午,题主可以一起研究下
在OkHttp 2.6 下,
public Builder cacheControl(CacheControl cacheControl) {
String value = cacheControl.toString();
if (value.isEmpty()) return removeHeader("Cache-Control");
return header("Cache-Control", value);
}
设置了策略会覆盖头字段的,所以头字段写缓存字段 没必要。
然后在OkHttp 3.0下
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
用最新的引用,cacheControl无效,我研究了一下午,题主可以一起研究下