public async Task AddRecordAsync(string zoneName, DnsEntry entry) { await EnsureLoggedInAsync(); var request = new DnsEntryRequest { DnsEntry = entry }; var response = await _httpClient.PostAsync($"domains/{zoneName}/dns", request); response.EnsureSuccessStatusCode(); }
public async Task AddRecordAsync(string zoneName, DnsEntry entry) { await EnsureLoggedInAsync(); var request = new DnsEntryRequest { DnsEntry = entry }; var response = await _httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Post, $"domains/{zoneName}/dns") { Content = new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json") }); response.EnsureSuccessStatusCode(); }