I'm trying to get the value of the variable
My actual code is:
const curl = require('curl');
var url = "https://login.microsoftonline.com/meuid/oauth2/v2.0/token"
var body = "client_id=meuid&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret=meuid&grant_type=client_credentials"
var options = "Content-Type: application/x-www-form-urlencoded"
var x = "";
curl.post(url, body, options, function(err, response, xbody) {
var x = xbody
})
console.log('result' + x)
What i'm doing wrong? why i cant get the value?