我有一个搜索域的方法,该方法返回是否可以注册。我无法访问返回的JSON正文中的“状态”字符串。
这是我用于访问API的AngularJS代码:
hosting.searchDomain = function() {
var domain = hosting.domain;
var tld = hosting.tld;
var url = apUrl + 'api/domains/available.json?auth-userid='+ resellerId +'&api-key='+ key +'&domain-name='+ domain +'&tlds='+ tld +'';
$http({
method: 'GET',
url: url,
}).then(function successCallback(response) {
var data = response.data;
console.log(data);
hosting.searchResults = data;
}, function errorCallback(response) {
console.log('Eror: ', response);
});
}
当您搜索mydomains.com时,返回的内容如下:
{"mydomains.com":{"status":"regthroughothers","classkey":"domcno"}}
我不明白如何访问状态字符串?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句