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.Buildercreate(com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider, com.microsoft.kiota.RequestOption[] requestOptions) Creates an OkHttpClient Builder with the Authorization handler and optional custom default middleware configurationsstatic okhttp3.OkHttpClient.Buildercreate(com.microsoft.kiota.RequestOption[] requestOptions) Creates an OkHttpClient Builder with the default configuration and middleware options.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 okhttp3.Interceptor[]createDefaultInterceptors(com.microsoft.kiota.RequestOption[] requestOptions) Creates the default interceptors for the client.static List<okhttp3.Interceptor> Deprecated.
-
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(@Nonnull com.microsoft.kiota.RequestOption[] requestOptions) Creates an OkHttpClient Builder with the default configuration and middleware options.- Parameters:
requestOptions- The request options to use for the interceptors.- Returns:
- an OkHttpClient Builder instance.
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create(@Nonnull 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 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.
-
create
@Nonnull public static okhttp3.OkHttpClient.Builder create(@Nonnull com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider, @Nonnull com.microsoft.kiota.RequestOption[] requestOptions) Creates an OkHttpClient Builder with the Authorization handler and optional custom default middleware configurations- Parameters:
authenticationProvider- authentication provider to use for the AuthorizationHandler.requestOptions- The request options to use for the interceptors.- Returns:
- an OkHttpClient Builder instance.
-
createDefaultInterceptors
@Nonnull public static okhttp3.Interceptor[] createDefaultInterceptors()Creates the default interceptors for the client.- Returns:
- an array of interceptors.
-
createDefaultInterceptors
@Nonnull public static okhttp3.Interceptor[] createDefaultInterceptors(@Nonnull com.microsoft.kiota.RequestOption[] requestOptions) Creates the default interceptors for the client.- Parameters:
requestOptions- The request options to use for the interceptors.- Returns:
- an array of interceptors.
-
createDefaultInterceptorsAsList
Deprecated.UsecreateDefaultInterceptors()instead.Creates the default interceptors for the client.- Returns:
- an array of interceptors.
-
createDefaultInterceptors()instead.