Answers for "how to post data using fethch"

1

how to post data using fethch

fetch('url here', {
    method: 'POST',
    headers: {'Content-Type':'application/x-www-form-urlencoded'}, // this line is important, if this content-type is not set it wont work
    body: 'foo=bar&blah=1'
});
Posted by: Guest on September-19-2020

Code answers related to "how to post data using fethch"

Browse Popular Code Answers by Language