コード例 #1
0
        /// <summary>
        /// Returns the DomainSettings Object
        /// </summary>
        /// <param name="domainName">DomainName to be interogated.</param>
        /// <returns></returns>
        private async Task <DomainSetting> GetDomainSettingsAsync(string domainName)
        {
            //Sanitize API URL
            var _providerEndpoint = APIUrl.Replace('"', ' ');

            _providerEndpoint = _providerEndpoint.Trim();

            if (!_providerEndpoint.Contains("https"))
            {
                _providerEndpoint = "https://" + _providerEndpoint;
            }

            var client = new RestClient(_providerEndpoint);

            var request  = new RestRequest("/v2/" + domainName + "/settings", Method.GET);
            var response = new RestResponse();

            response = await GetResponseContentAsync(client, request) as RestResponse;

            return(JsonConvert.DeserializeObject <DomainSetting>(response.Content));
        }