Ejemplo n.º 1
0
        private void AddAuthorizationHeaders(string phone, string code)
        {
            const string authHeaderName     = "Authorization";
            const string deviceIdHeaderName = "device-id";
            const string deviceOsHeaderName = "device-os";
            var          credentionalBuffer = new UTF8Encoding().GetBytes($"{phone}:{code}");

            _client.AddDefaultHeaders(new Dictionary <string, string>
            {
                { authHeaderName, $"Basic {Convert.ToBase64String(credentionalBuffer)}" },
                { deviceIdHeaderName, "" },
                { deviceOsHeaderName, "" }
            });
        }