Ejemplo n.º 1
0
 /// <summary>
 /// Retrieve DNS Records for the specified Domain, optionally with the specified Type and/or Name
 /// </summary>
 /// <param name="request"></param>
 /// <param name="domain"></param>
 /// <param name="Type"></param>
 /// <param name="Name"></param>
 /// <param name="XShopperId"></param>
 /// <returns></returns>
 public async Task<List<DNSRecordResponse>> RetrieveDNSRecordsWithTypeAndName(DNSRecordRetrieve request,string domain, string Type, string Name, string XShopperId = null)
 {
     CheckRequestValid(request);
     var client = GetBaseHttpClient();
     if (XShopperId != null)
         client.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
     string urlPath = "domains/{domain}/records";
     if (string.IsNullOrEmpty(Name)
         urlPath = $"domains/{domain}/records/{Type}";
     else
         urlPath = $"domains/{domain}/records/{Type}/{Name}";
     var response = await client.GetAsync($"{urlPath}{QueryStringBuilder.RequestObjectToQueryString(request)}");
     await CheckResponseMessageIsValid(response);
     return await response.Content.ReadAsAsync<List<DNSRecordResponse>>();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve DNS Records for the specified Domain, optionally with the specified Type and/or Name
        /// </summary>
        /// <param name="request"></param>
        /// <param name="domain"></param>
        /// <param name="Type"></param>
        /// <param name="Name"></param>
        /// <param name="XShopperId"></param>
        /// <returns></returns>
        public async Task <List <DNSRecordResponse> > RetrieveDNSRecordsWithTypeAndName(DNSRecordRetrieve request, string domain, string Type, string Name, string XShopperId = null)
        {
            CheckRequestValid(request);
            var client = GetBaseHttpClient();

            if (XShopperId != null)
            {
                client.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
            }
            string urlPath  = $"domains/{domain}/records/{Type}{(string.IsNullOrEmpty(Name) ? "" : $"/{Name}")}";