Answers for "node-fetch post body"

15

node js fetch

const fetch = require('node-fetch');	//npm install node-fetch

fetch('https://httpbin.org/post', {
  method: 'POST',
  body: 'a=1'
})
  .then(res => res.json())
  .then(json => {
	// Do something...
  })
  .catch(err => console.log(err));
Posted by: Guest on June-02-2020
0

make post request POST with node-fetch

npm install --save node-fetch
Posted by: Guest on May-17-2021
-1

node fetch response body

 fetch('https://api.github.com/users/github')    
   .then(res => res.json())    
   .then(json => console.log(json));
Posted by: Guest on June-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language