0

我正在使用hardus 的npm 包 https向 NOAA 发出获取请求。NOAA的文档很差,而且 https 包上的文档不存在,而且我在设置标头时遇到了麻烦。这是我的请求代码,

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...
  }
}

如何向我的请求添加标头以包含 Web 服务令牌?

4

0 回答 0