function request(playlist) {
var data = JSON.stringify({
'playlist': playlist,
'instanceid': 1,
'user': config.loginUsername,
'pass': config.loginPassword,
'botIp': config.botIp,
'botPort': config.botPort,
'design': designs[config.avatarDesign]
});
sinusbot.http({
'method': 'POST',
'url': avatarUrl,
'body': data,
'headers': {
'Content-Type': 'application/json; charset=utf-8',
'Content-Length': lengthInUtf8Bytes(data)
},
'timeout': 4000
}, function(error, response) {
return {'error': error, 'response': response.data};
});
}
Comments