Class KiotaClientFactory

java.lang.Object
com.microsoft.kiota.http.KiotaClientFactory

public class KiotaClientFactory extends Object
This class is used to build the HttpClient instance used by the core service.
  • Method Summary

    Modifier and Type
    Method
    Description
    static okhttp3.OkHttpClient.Builder
    Creates an OkHttpClient Builder with the default configuration and middleware.
    static okhttp3.OkHttpClient.Builder
    create(com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider)
    Creates an OkHttpClient Builder with the default configuration and middleware including the AuthorizationHandler.
    static okhttp3.OkHttpClient.Builder
    create(com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider authenticationProvider, com.microsoft.kiota.RequestOption[] requestOptions)
    Creates an OkHttpClient Builder with the Authorization handler and optional custom default middleware configurations
    static okhttp3.OkHttpClient.Builder
    create(com.microsoft.kiota.RequestOption[] requestOptions)
    Creates an OkHttpClient Builder with the default configuration and middleware options.
    static okhttp3.OkHttpClient.Builder
    create(List<okhttp3.Interceptor> interceptors)
    Creates an OkHttpClient Builder with the default configuration and middleware.
    static okhttp3.OkHttpClient.Builder
    create(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 @Nonnull public static List<okhttp3.Interceptor> createDefaultInterceptorsAsList()
      Deprecated.
      Creates the default interceptors for the client.
      Returns:
      an array of interceptors.