【发布时间】:2017-12-03 00:28:03
【问题描述】:
我正在尝试使用 Spotify API 搜索功能来接收专辑数据。这是我的要求:
request.post(authOptions, function(error, response, body) {
if (!error && response.statusCode === 200) {
// use the access token to access the Spotify Web API
var token = body.access_token;
var options = {
url: 'https://api.spotify.com/v1/search',
data: {
q: 'currents',
type: 'album',
},
headers: {
'Authorization': 'Bearer ' + token
},
json: true
};
request.get(options, function(error, response, body) {
console.log(body);
});
}
});
但是,当执行此代码时,我不断收到错误代码 400 - “无搜索查询”响应。谁能帮助找出为什么我的查询选项没有被正确读取?
谢谢。
【问题讨论】:
标签: javascript http spotify