2015-12-26 45 views
2

按照成熟的REST API文档,查找IP地址,需要在其后指定格式的要求:RIPE:如何使用REST API

http://rest.db.ripe.net/ {来源}/{OBJECTTYPE}/{键}

所以我假设查找IP地址将是这样的:

http://rest.db.ripe.net/ripe/inetnum/193.0.6.142.json

但是,我得到的回应是:

{ 
    "link": { 
    "type": "locator", 
    "href": "http://rest.db.ripe.net/ripe/inetnum/193.0.6.142" 
    }, 
    "errormessages": { 
    "errormessage": [ 
     { 
     "severity": "Error", 
     "text": "ERROR:101: no entries found\n\nNo entries found in source %s.\n", 
     "args": [ 
      { 
      "value": "RIPE" 
      } 
     ] 
     } 
    ] 
    }, 
    "terms-and-conditions": { 
    "type": "locator", 
    "href": "http://www.ripe.net/db/support/db-terms-conditions.pdf" 
    } 
} 

我在做什么错?

回答

2

看起来像https://rest.db.ripe.net/search.json?query-string=193.0.6.142是正确的链接使用。这似乎为我的ripe.net看到

+0

我使用的WHOIS查询这给属于该IP地址的所有结果。 'function getRIPEWhoisUrl(ipv4){ return“https://apps.db.ripe.net/search/query.html?searchtext="+ ipv4 +”#resultsAnchor“; } '使用标头'Accept:application/json'来获取JSON结果 –