-
Notifications
You must be signed in to change notification settings - Fork 57
Authentication
Itay Sagui edited this page Nov 19, 2020
·
1 revision
HttpClient httpClient = new HttpClient();
IClient client = new Client(httpClient);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);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); var networkCredentials = new NetworkCredential { UserName = "USERNAME" , Password = "PASSWORD"};
IClient client = new Client(networkCredentials);