Retrofit 2: How to set individual timeouts on specific requests?
问题 I have set a global timeout in my Retrofit adapter by doing OkHttpClient okHttpClient = new OkHttpClient(); okHttpClient.setReadTimeout(20, TimeUnit.SECONDS); okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS); retrofit = new Retrofit.Builder() .client(okHttpClient) .build(); Great! But I would like to set an specific timeout for certain requests E.g. public interface MyAPI { @GET() Call<Void> notImportant (@Url String url); @GET Call<Void> veryImportant(@Url String url); So veryImportant