SHARE
TWEET

Untitled

a guest Jun 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const fetch = require('node-fetch');
  2. const querystring = require('querystring');
  3.  
  4. const mydata = { one: "test1", two: "test2" };
  5. const params = {
  6.         method: 'POST',
  7.         body: querystring.stringify(mydata),
  8.         headers: {
  9.              'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
  10.              'APIKEY': '123456'
  11. }
  12. };
  13. const response =  await fetch(url, params);
  14. const jsonData = await response.json();
  15. console.log(jsonData);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top