Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 9, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/0911a896ec18d54a04bdc04edafa1341 to your computer and use it in GitHub Desktop.
Save parzibyte/0911a896ec18d54a04bdc04edafa1341 to your computer and use it in GitHub Desktop.
fetch("/ruta", {
headers: {
'X-CSRF-TOKEN': window.CSRF_TOKEN// <--- aquí el token
},
method: "POST",
body: JSON.stringify({
"nombre": "Luis",
"web": "parzibyte.me"
})
})
.then(r => r.json())
.then(respuesta => {
console.log(respuesta);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment