我正在编写一个 nodejs 应用程序以通过 API 从站点检索脚本文件。
如果我使用 curl 命令行,一切正常,但我得到了
“需要授权”
从我的 nodejs 代码返回的状态代码。
我正在使用“node-libcurl”库,并尝试通过以下方式传递授权代码:
const curl = new Curl();
.....
curl.setopt(Curl.option.XOAUTH2_BEARER, "xxxxxxxxxxxxxxxxx");
.....
其中 xxxxxxxxxxxxxxxx 是承载授权码。这个语法不正确吗?