请求承诺原生Node.js中的Cookie

时间:2018-08-13 13:53:21

标签: node.js cookies promise request

Im正在访问一个API,该API的返回值除了回答他的cookie外。 但我看不到代码中。我可以看到邮递员返回的cookie。 我正在使用请求承诺库,我只看到答案,而不是cookie。

如何从答案中获取Cookie?

return rp(baseAddress, { form: apiCredentials, json: true, method: "POST" })
        .then(response => {
            if (response) {
              console.log(response)
            }
            else {
                DefaultLogger.error("could not authenticate ", response)
            })

0 个答案:

没有答案