javascript fetch api post
fetch('https://example.com/profile', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ 'foo': 'bar' }), }) .then((res) => res.json()) .then((data) => { // Do some stuff ... }) .catch((err) => console.log(err));