followRedirects(false)
private OkHttpClient getOkHttpClient() {
if (client == null) {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
client = new OkHttpClient.Builder()
.writeTimeout(20, TimeUnit.SECONDS)
.connectTimeout(5, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.addInterceptor(httpLoggingInterceptor)
.followRedirects(false)
.build();
}
return client;
}