我正在使用Jquery将JSON数据发送到Grooveshark API以获取搜索结果,但是当我发出帖子请求时,Grooveshark返回:
{"errors":[{"code":2,"message":"Method not found."}]}
我不确定我缺少什么,但我对POST json数据的调用如下:
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: 'http://api.grooveshark.com/ws/3.0/?sig=MYSIGGOESHERE',
data: {"method":"getSongSearchResults","header":{"wsKey":"MYKEY"},"parameters":{"query":"we the kings","country":"1","limit":"2","offset":""}},
dataType: 'jsonp',
crossDomain: true,
async: false,
//json object to sent to the authentication url
success: function () {
alert("success!");
}
});
我也是在Chrome扩展程序中定义的脚本中进行这些调用。我认为这不应该影响帖子本身。