Through JQUERY, I need to make a request via POST
where I will get a JSON
with a token.
The JSON return I get after sending the POST is this:
{
"Token": "e27bb0a7-e65b-4cc3-a82e-7a2a3c26a248",
"Codigo": 0
}
My question is: How do I read this token? One analyst informed me that I should do something like this:
$(document).ready(function() {
var settings = {
"async": true,
"crossDomain": true,
"url": "https://siteexemplo.br/login/geraTok",
"method": "POST",
"headers": {
"content-type": "application/json",
},
"data": {
"RA": "12345",
"senha": "xxx"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
});
But after that? Where's the token? How do I pass it to a variable for example?
Thank you guys!