how to install node fetch
$ npm install node-fetch --save
how to install node fetch
$ npm install node-fetch --save
fetch api with express
const url ='https://example.com';
const headers = {
"Content-Type": "application/json",
"client_id": "1001125",
"client_secret": "876JHG76UKFJYGVHf867rFUTFGHCJ8JHV"
}
const data = {
"name": "Wade Wilson",
"occupation": "Murderer",
"age": "30 (forever)"
}
fetch(url, { method: 'POST', headers: headers, body: data})
.then((res) => {
return res.json()
})
.then((json) => {
// Do something with the returned data.
console.log(json);
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us