Package com.microsoft.graph.httpcore
Class HttpClients
java.lang.Object
com.microsoft.graph.httpcore.HttpClients
Builder to get a custom HttpClient to be used for requests against Microsoft Graph
-
Method Summary
Modifier and TypeMethodDescriptionstatic okhttp3.OkHttpClientCreatesOkHttpClientinstance with default configuration and provided authProviderstatic okhttp3.OkHttpClientcreateFromInterceptors(okhttp3.Interceptor[] interceptors) CreatesOkHttpClientinstance with interceptorsstatic okhttp3.OkHttpClient.Buildercustom()Creates builder object for construction of customOkHttpClientinstances.
-
Method Details
-
custom
@Nonnull public static okhttp3.OkHttpClient.Builder custom()Creates builder object for construction of customOkHttpClientinstances.- Returns:
- OkHttpClient.Builder() custom builder for developer to add its own interceptors to it
-
createDefault
CreatesOkHttpClientinstance 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) CreatesOkHttpClientinstance with interceptors- Parameters:
interceptors- Use interceptors provided while constructing http client- Returns:
- OkHttpClient build with interceptors provided
-