https://www.npmjs.com/package/node-fetch Node v6.4.0 npm v3.10.3
I want to send a GET Request with custom headers in this API call.
const fetch = require('node-fetch')
var server = 'https://example.net/information_submitted/'
var loginInformation = {
username: "example@example.com",
password: "examplePassword",
ApiKey: "0000-0000-00-000-0000-0"
}
var headers = {}
headers['This-Api-Header-Custom'] = {
Username: loginInformation.username,
Password: loginInformation.password,
requiredApiKey: loginInformation.ApiKey
}
fetch(server, { method: 'GET', headers: headers})
.then((res) => {
console.log(res)
return res.json()
})
.then((json) => {
console.log(json)
})
The headers are not applying, I am denied access. But within a curl command, it works perfectly.