|
@@ -22,12 +22,13 @@ public class GoDaddyDomainProvider : DomainProvider
|
|
|
|
|
|
public override void PutIp(DomainConfigEntry config, string ip)
|
|
|
{
|
|
|
- var req = new HttpRequestMessage(HttpMethod.Get, $"https://api.godaddy.com/v1/domains/{config.Domain}/records/A/{config.RecordName}");
|
|
|
+ var req = new HttpRequestMessage(HttpMethod.Put, $"https://api.godaddy.com/v1/domains/{config.Domain}/records/A/{config.RecordName}");
|
|
|
req.Headers.Add("Authorization", $"sso-key {config.Key}:{config.Secret}");
|
|
|
req.Content = new StringContent($"[{{\"data\":\"{ip}\",\"ttl\":600}}]", Encoding.UTF8, "application/json");
|
|
|
|
|
|
using var http = CreateHttpClient(config);
|
|
|
var response = http.Send(req);
|
|
|
response.EnsureSuccessStatusCode();
|
|
|
+ var result = response.Content.ReadAsStringAsync().Result;
|
|
|
}
|
|
|
}
|