0

这就是我所拥有的:

$.ajax({
  type:'get',
  url: 'https://services.rdio.com/api/1/',
  dataType: "JSONP",
  method: 'getTopCharts'
  success: function(data) {
    console.log(data);
  }
})

我不太擅长使用 API。我想获得 json 格式的顶级图表。现在这是我在控制台中看到的,旁边有一个 x:

https://services.rdio.com/api/1/?method=getTopCharts&callback=jQuery21406818272015079856_1447092130458&_=1447092130459

我需要使用 API 密钥吗?在文档中它说不需要用户身份验证。那么如何获取我的列表呢?

4

1 回答 1

0

All Rdio API requests must use the POST method and contain an access token. Checkout the Rdio API Overview. Rdio doesn't support JSONP, but CORS is supported. Using jQuery, the request would look like:

$.ajax({
  method: "POST",
  url: "https://services.rdio.com/api/1/get",
  data: {
    method: "get",
    keys: "r139688",
    access_token: "ACCESS_TOKEN"
  }
})

You'll need to fill-in your own access token. Checkout the OAuth 2.0 documentation for how to generate an access token.

于 2015-11-09T23:35:17.647 回答