Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fetch = require('node-fetch');
- const querystring = require('querystring');
- const mydata = { one: "test1", two: "test2" };
- const params = {
- method: 'POST',
- body: querystring.stringify(mydata),
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
- 'APIKEY': '123456'
- }
- };
- const response = await fetch(url, params);
- const jsonData = await response.json();
- console.log(jsonData);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement