Package com.microsoft.kiota.http
Class KiotaClientFactory
java.lang.Object
com.microsoft.kiota.http.KiotaClientFactory
This class is used to build the HttpClient instance used by the core service.
-
Method Summary
Modifier and TypeMethodDescriptionstatic okhttp3.OkHttpClient.Buildercreate()Creates an OkHttpClient Builder with the default configuration and middleware.static okhttp3.OkHttpClient.Buildercreate(com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider) Creates an OkHttpClient Builder with the default configuration and middleware including the AuthorizationHandler.static okhttp3.OkHttpClient.BuilderCreates an OkHttpClient Builder with the default configuration and middleware.static okhttp3.OkHttpClient.Buildercreate(okhttp3.Interceptor[] interceptors) Creates an OkHttpClient Builder with the default configuration and middleware.static okhttp3.Interceptor[]Creates the default interceptors for the client.static List<okhttp3.Interceptor> Creates the default interceptors for the client.
-
Method Details
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create()Creates an OkHttpClient Builder with the default configuration and middleware.- Returns:
- an OkHttpClient Builder instance.
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create(@Nullable okhttp3.Interceptor[] interceptors) Creates an OkHttpClient Builder with the default configuration and middleware.- Parameters:
interceptors- The interceptors to add to the client. Will default to createDefaultInterceptors() if null.- Returns:
- an OkHttpClient Builder instance.
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create(@Nullable List<okhttp3.Interceptor> interceptors) Creates an OkHttpClient Builder with the default configuration and middleware.- Parameters:
interceptors- The interceptors to add to the client. Will default to createDefaultInterceptors() if null.- Returns:
- an OkHttpClient Builder instance.
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create(@Nonnull com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider) Creates an OkHttpClient Builder with the default configuration and middleware including the AuthorizationHandler.- Parameters:
authenticationProvider- authentication provider to use for the AuthorizationHandler.- Returns:
- an OkHttpClient Builder instance.
-
createDefaultInterceptors
@Nonnull public static okhttp3.Interceptor[] createDefaultInterceptors()Creates the default interceptors for the client.- Returns:
- an array of interceptors.
-
createDefaultInterceptorsAsList
Creates the default interceptors for the client.- Returns:
- an array of interceptors.
-