I have a NodeJS code that uses https module as: https.request(options, (res) => {...... where options is an object like
const options = {
hostname: SERVICE_HOSTNAME,
path: BASE_PATH,
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
ApplicationId,
Authorization
}
};
My problems start when I add Accept header. I getting an error:
TypeError [ERR_INVALID_HTTP_TOKEN]: Header name must be a valid HTTP token ["Accept"]
at ClientRequest.setHeader (_http_outgoing.js:472:3)
at new ClientRequest (_http_client.js:203:14)
at Object.request (https.js:289:10)
How Accept header would be invalid?
