public KubeHttpClient(IKubeHttpClientSettingsProvider settingsProvider) : base(settingsProvider.CreateMessageHandler()) { this.Settings = settingsProvider; string token = settingsProvider.GetToken(); if (!string.IsNullOrEmpty(token)) { this.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); } this.BaseAddress = settingsProvider.ServiceBaseAddress; }
public KubeHttpClient( IKubeHttpClientSettingsProvider settingsProvider) : base(settingsProvider.CreateMessageHandler()) { this.Settings = settingsProvider; string token = settingsProvider.GetToken(); if (!string.IsNullOrEmpty(token)) { _logger.LogDebug("Access token is not null. Set default request header."); this.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); } else { _logger.LogWarning("Access token is null."); } this.BaseAddress = settingsProvider.ServiceBaseAddress; }