Lets say we need to retry a request in case of exception:
public class TestUpInterceptor implements Interceptor {
@Override public Response intercept(Chain chain) throws IOException {
final Response response = chain.proceed(chain.request());
//TODO: in case of exception retry in 3 sec
return retryResponse;
}
}
how to add a delay to interceptor?