Square9Api/ApiClient.cs
/// <summary>
/// Set a Basic Authentication header to the request to provide authorization.
/// </summary>
/// <param name="config"></param>
Set a Basic Authentication header to the request to provide authorization.
Set a Basic Authentication header to the request to provide authorization .
private void SetAuthHeader()
        {
            _client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
                "Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($"{config.Username}:{config.Password}")));
        }
private void SetAuthHeader ( ) { _client . DefaultRequestHeaders . Authorization = new System . Net . Http . Headers . AuthenticationHeaderValue ( " " , Convert . ToBase64String ( Encoding . ASCII . GetBytes ( $" { config . Username } : { config . Password } " ) ) ) ; }
Set a Basic Authentication header to the request to provide authorization.
Set a Basic Authentication header to the request to provide authorization .
config
None