All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.devcycle.sdk.server.common.api.APIUtils Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package com.devcycle.sdk.server.common.api;

import com.devcycle.sdk.server.common.interceptor.CustomHeaderInterceptor;
import okhttp3.OkHttpClient;

public class APIUtils {
    public static void applyRestOptions(IRestOptions restOptions, OkHttpClient.Builder builder) {
        if (restOptions != null) {
            if (restOptions.getHostnameVerifier() != null) {
                builder.hostnameVerifier(restOptions.getHostnameVerifier());
            }

            if (restOptions.getSocketFactory() != null && restOptions.getTrustManager() != null) {
                builder.sslSocketFactory(restOptions.getSocketFactory(), restOptions.getTrustManager());
            }
            builder.addInterceptor(new CustomHeaderInterceptor(restOptions));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy