laravel fetch post
fetch(url, {
headers: {
"Content-Type": "application/json",
"Accept": "application/json, text-plain, */*",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": token
},
method: 'post',
credentials: "same-origin",
body: JSON.stringify({ name: name, number: number }) })
.then((data) => {
form.reset();
window.location.href = redirect;
})
.catch(function(error) {
console.log(error);
});
}
Also in JavaScript:
- javascript date parse yyyy-mm-dd
- javascript get last url segment
- how to get the last eleemnt of an array
- immediately invoked function expression
- ngswitchcase in angular 8
- jquery reload page
- regeneratorruntime is not defined
- Better Array check with Array.isArray Because arrays are not true array in JavaScript, there is no simple typeof check. No problem! Use the method Array.isArray to check…
- jquery on click return link url
- how to give roles discord.js
- new date getday js
- run after 1s javascript
- how to get the last element in javascript
- pagination.js
- añadir react a node project
- user account in react
- how to use reduce in javascript
- how to get unique values from array in javascript without duplicate value
- how to draw a triangle using javascript
- collapse vscode key
- how to make pages from list in nodejs
- TypeError: client.guilds.forEach is not a function
- create overlay js
- multiple path names for a same component in react router