Skip to content
Itay Sagui edited this page Nov 19, 2020 · 1 revision

Using HttpClient

    HttpClient httpClient = new HttpClient();
    IClient client = new Client(httpClient);

Using an Access Token

If you already have an Access Token, you can configure the HttpClient

    HttpClient httpClient = new HttpClient();
    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
    IClient client = new Client(httpClient);

Using an upload-dedicated HttpClient

If you want to have special settings for uploads, such as longer timeout, you can use an instance of HttpClientWrapper

    HttpClient httpClient = new HttpClient();
    HttpClient uploadHttpClient = new HttpClient();

    HttpClientWrapper httpClientWrapper = new HttpClientWrapper(httpClient, uploadHttpClient);
    IClient client = new Client(httpClientWrapper);

Using NetworkCredential

    var networkCredentials = new NetworkCredential { UserName = "USERNAME" , Password = "PASSWORD"};
    IClient client = new Client(networkCredentials);

Clone this wiki locally