HttpClients Class

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

public class HttpClients

Builder to get a custom HttpClient to be used for requests against Microsoft Graph

Method Summary

Modifier and Type Method and Description
static okhttp3.OkHttpClient createDefault(IAuthenticationProvider auth)

Creates OkHttpClient instance with default configuration and provided authProvider

static okhttp3.OkHttpClient createFromInterceptors(Interceptor[] interceptors)

Creates OkHttpClient instance with interceptors

static okhttp3.OkHttpClient.Builder custom()

Creates builder object for construction of custom OkHttpClient instances.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

createDefault

public static OkHttpClient createDefault(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

public static OkHttpClient createFromInterceptors(Interceptor[] interceptors)

Creates OkHttpClient instance with interceptors

Parameters:

interceptors - Use interceptors provided while constructing http client

Returns:

OkHttpClient build with interceptors provided

custom

public static 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

Applies to