let data = new Object();
data = {
// data
}
var form = new URLSearchParams(data);
const url = `${baseUrl}/`;
var request = new Request(url, {
method: 'POST',
body: form,
headers: new Headers({
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
})
});
fetch(request)
.then(response => response.json())
.then(function(data) {
console.log();
})
.catch(function(error) {
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter