Пример #1
0
        public LivyRestApi(LivySettings settings)
        {
            Settings = settings;
            _client  = new HttpClient();
            _client.DefaultRequestHeaders.Accept.Clear();
            _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
                                                                                        (settings.Username + ":" + settings.Password).Base64Encode());

            _serviceUri = string.Format(ServiceUriTemplate, settings.ClusterName);
        }
Пример #2
0
        public LivyRestApi(LivySettings settings)
        {
            Settings = settings;
            _client  = new HttpClient();
            _client.DefaultRequestHeaders.Accept.Clear();
            _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
                                                                                        Convert.ToBase64String(Encoding.UTF8.GetBytes(settings.Username + ":" + settings.Password)));

            _serviceUri = settings.ClusterUri;
        }