<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Title</title>
</head>
<body>
<form>
<input type="email" name="email" placeholder="email">
<button type="button" id="send">enviar</button>
</form>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script type="text/javascript">
$('#send').on('click', function(){
$.ajax({
url: "URL QUE RETORNA O TOKEN",
method: "post",
contentType: "application/json",
data: '{ "email": "[email protected]" }',
success: function (data) {
console.log(data);
}
});
});
</script>
</body>
</html>
OBS: console.log (data); IT RETURNS TOKEN PERFECTLY