Class HttpClients

java.lang.Object
com.microsoft.graph.httpcore.HttpClients

public class HttpClients extends Object
Builder to get a custom HttpClient to be used for requests against Microsoft Graph
  • Method Details

    • custom

      @Nonnull public static okhttp3.OkHttpClient.Builder custom()
      Creates builder object for construction of custom OkHttpClient instances.
      Returns:
      OkHttpClient.Builder() custom builder for developer to add its own interceptors to it
    • createDefault

      @Nonnull public static okhttp3.OkHttpClient createDefault(@Nonnull IAuthenticationProvider auth)
      Creates OkHttpClient instance with default configuration and provided authProvider
      Parameters:
      auth - Use IAuthenticationProvider instance provided while constructing http client
      Returns:
      OkHttpClient build with authentication provider given, default redirect and default retry handlers
    • createFromInterceptors

      @Nonnull public static okhttp3.OkHttpClient createFromInterceptors(@Nullable okhttp3.Interceptor[] interceptors)
      Creates OkHttpClient instance with interceptors
      Parameters:
      interceptors - Use interceptors provided while constructing http client
      Returns:
      OkHttpClient build with interceptors provided