Tuesday 2 July 2019

javascript - How do I return the var in this function from request?

Is it possible for me to get the data from body.message to use outside that function?



I've tried this so far.



    var codetocheck;
request({
url: link,
json: true
},function (err, resp, body){
codetocheck = body.message;//var I want to use outside this function

})

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...