private OkHttpClient createOkHttpClient ( OkHttpAuthenticator authenticator , int logLevel ) { OkHttpClient . Builder builder = new OkHttpClient . Builder ( ) . addInterceptor ( loggingInterceptor ( logLevel ) ) . connectTimeout ( CONNECT_TIMEOUT , TimeUnit . SECONDS ) . writeTimeout ( WRITE_TIMEOUT , TimeUnit . SECONDS ) . readTimeout ( READ_TIMEOUT , TimeUnit . SECONDS ) . authenticator ( authenticator ) ; return builder . build ( ) ; }
Create and configure OkHTTP client .