// Get
fetch('<your-url>')
.then((response) => response.json()).then(console.log).catch(console.warn);
// POST, PUT
data = "your data"
fetch('<your-url>', {
method: 'POST', // or 'PUT'
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
.then(response => response.json()).then(console.log).catch(console.warn);