我使用Retrofit 1.9.0和OkHttp 2.0.0
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
Run Code Online (Sandbox Code Playgroud)
但是没有找到拦截器方法
OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(50000, TimeUnit.MILLISECONDS);
client.setReadTimeout(50000, TimeUnit.MILLISECONDS);
client.interceptor().add(...); // cannot resolve method interceptor
Run Code Online (Sandbox Code Playgroud)
我正在处理改造中的重试请求,这篇文章建议 如何使用OkHttp/Retrofit重试HTTP请求?
我在这里错过了一些图书馆吗?