0

I'm using npm package https by hardus to make get requests to NOAA. Documentation on NOAA is poor and on the https package is non-existent, and I am having trouble setting a header. Here is my code for my requests,

https.get(url, function(res) {
  res.setEncoding('utf8');
  res.on('data', (chunk) => {
    //Parse through and deal with data...
  }
  res.on('error', (e) => {
    //Deal with error...
  }
}

How can I add a header to my request to include the Web Service Token?

notphilphil
  • 385
  • 5
  • 16
  • 3
    As an aside, if you're looking for a more robust and well-known `npm` package with good documentation, [request](https://www.npmjs.com/package/request) may be what you're looking for! – rageandqq Jun 27 '17 at 16:43
  • `https` is an empty package, you're actually using the standard [`https` module](https://nodejs.org/api/https.html). – robertklep Jun 27 '17 at 16:57

0 Answers0