hey, i am actually rly new to java script and i have this problem.
i want to fetch some http and want to print it outsite of the request, but it dosnt work.
can anyone help me with that?
i want to fetch some http and want to print it outsite of the request, but it dosnt work.
can anyone help me with that?
Code:
async function getSummonerByName(name) {
var url = "";
var test;
await http.simpleRequest({
'method': 'GET',
'url': url,
'timeout': 6000,
}, function (error, response) {
if (error) {
engine.log("Error: " + error);
return;
}
if (response.statusCode != 200) {
engine.log("HTTP Error: " + response.status);
return;
}
// success!
test = response.data.toString();
});
engine.log(test);
}