fetch('urlToPost', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ key: 'value' }),
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch((error) => {
console.error('Error:', error);
});
Fetch POST
Initiate a fetch call with POST method
Shortcut: request.post
0 Comments
Add Comment
Log in to add a comment