Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

okhttpconfig

@Configuration
class OkHttpConfig {

    @Bean
    fun okHttpClient(): OkHttpClient {
        return OkHttpClient.Builder()
                .readTimeout(60, TimeUnit.SECONDS)
                .writeTimeout(60, TimeUnit.SECONDS)
                .addInterceptor(HttpLoggingInterceptor())
                .build()
    }
}
Source by www.javacodemonk.com #
 
PREVIOUS NEXT
Tagged: #okhttpconfig
ADD COMMENT
Topic
Name
7+4 =