我正在使用 godaddy api 访问域。我被推荐了, https://developer.godaddy.com/doc/endpoint/domains#/v1/recordReplace
我想在 Godaddy 的域中添加 CNAME。
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "sso-key {key}:{secret}");
var requestURl = "https://api.godaddy.com/v1/domains/mydomain.com/";
string body = "{\"data\": \"xxxxx.azurewebsites.net\",\"name\": \"xxxx\",\"type\": \"CNAME\"}";
var stringContent = new StringContent(body, Encoding.UTF8, "application/json");
var response = client.GetAsync(requestURl).GetAwaiter().GetResult(); ;
if (response.StatusCode == HttpStatusCode.Created)
{
}
}
但我收到错误代码 422。知道为什么会出现这些错误吗?