I'm looking for a way to use a parameters outside his function, i wrote this:
await checkrequest(checkoptions, async function (error, response, body) {
await console.error('error:', error); // Print the error if one occurred
await console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
await console.log('body:', body);
var string;
string = body.toString();
});
}while(string.includes("NotFound") == true)
But the body in the while Is not seen as already declared, I also tried to put the "var string" outside the function, but nothing, it doesnt take the body value.