2015-12-26 46 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結果 –