429(请求过多)通过 cors-anywhere.herokuapp 调用 Hubspot API 时出错

问题描述 投票:0回答:2

我正在尝试使用 React 构建一个 Web 应用程序,为此我使用 Hubspot API 来管理我帐户中的联系人。对于 HTTP 请求,我将 JavaScript 库“request-promise”与代理服务器结合使用:https://cors-anywhere.herokuapp.com/

代码如下:

do{
    //Here I'm making http request constantly
}while(process);

大约 100 个 HTTP 请求后,应用程序向我显示错误:

获取 https://cors-anywhere.herokuapp.com/https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=${hapiKey}&count=1000 429(请求过多)

https://cors-anywhere.herokuapp.com/ 似乎存在速率限制问题。有人有解决办法吗?

reactjs web-applications cors rate-limiting hubspot
2个回答
0
投票

429 请求太多 HTTP 429 Too Many Requests 响应状态代码表示用户在给定时间内发送了太多请求(“速率限制”)。

此响应中可能包含 Retry-After 标头,指示在发出新请求之前需要等待多长时间。

来源:https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429


-2
投票

您是否尝试过在本地运行服务器? https://github.com/Rob--W/cors-anywhere

© www.soinside.com 2019 - 2024. All rights reserved.