I am trying to add a custom header, X-Query-Key, to a HTTP request using Fetch API or request but when I add this to the header of the request it appears to fail at setting the headers and the Request Method is set to OPTIONS for some reason.
When I remove the header it goes back to being GET as it should do.
Sample code looks like below:
const options = { url: url, headers: { 'Accept': 'application/json', 'X-Query-Key': '123456' //Adding this breaks the request } }; return request(options, (err, res, body) => { console.log(body); });