1

我在 NodeJS 中编写了一个应该连接到 GA 的模块。我编写了一个授权模块,并将 https://www.googleapis.com/auth/analytics添加到范围。这很有效,我从 Google API 收到了一个令牌。

使用此令牌,我尝试连接到 Google Analytics API,但收到 ECONNRESET 错误,套接字挂断。

我在http://code.google.com/apis/console仔细检查了应用程序是否有权与 GA APi 交谈。

这是我用来连接 API 的选项。

host: 'www.googleapis.com',
port: 443,
path: '/analytics/v3/management/accounts',
method: 'GET',
headers: { Authorization: '********' }

有人知道出了什么问题吗?

谢谢!

4

0 回答 0