I am trying to get a artist profile from Echonest. I need to have a parameter named 'bucket' multiple times in the query string. I am trying to set it with an array with the object that I am passing. Is this possible to pass this in an array?
I have this:
bucket:['biographies', 'images', 'artist_location', 'urls'];
I want this:
bucket=biographies&bucket=images&bucket=artist_location&bucket=urls
Client:
getArtistProfile = function(artistName){
var params = {
format:'json',
bucket:['biographies', 'images', 'artist_location', 'urls'],
name:artistName
};
Meteor.call('getEchoNestData', params, function(error, result) {
if (error)
console.warn(error);
else
console.log(result);
});
};
Server Method:
getEchoNestData:function(type, params){
check(type, String);
params.api_key = Meteor.settings.echonest.apiKey;
var result = HTTP.get('http://developer.echonest.com/api/v4/artist/profile' + type, {timeout:5000, params:params});
return result;
}
_.reduceor something.