谷歌日历 API 和谷歌驱动器 API 允许批量请求。
为此,您需要在 www.googleapis.com/batch 上执行 POST
请求的正文包含您的不同请求的 GET/POST/DELETE 列表。
根据 https://developers.google.com/google-apps/calendar/batch和 https://developers.google.com/drive/web/batch
You can even group requests for multiple users or multiple Google APIs.
这是否意味着我可以在同一批次中发送对日历 API 的请求和对驱动器 API 的请求?
如果是这样,https://developers.google.com/google-apps/calendar/batch说:
You're limited to 50 calls in a single batch request. If you need to make more calls than that, use multiple batch requests.
和 https://developers.google.com/drive/web/batch说:
You're limited to 1000 calls in a single batch request. If you need to make more calls than that, use multiple batch requests.
哪个值是正确的?
有关其他 API 的更多信息:
对于 https://developers.google.com/webmaster-tools/v3/how-tos/batch
他们忘记提供主机名(www.googleapis.com ?)。在他们的例子中,他们只是把:
Host: host They say the limit is 1000 but didn't say if you can call others APIs in the same batch
对于 https://developers.google.com/admin-sdk/reseller/v1/how-tos/batch
它们在示例中显示:
他们说限制是 1000 并指定:
You can even group requests for multiple users or multiple Google APIs.
最佳答案
经过实验,是不是 可以在同一批次中混合不同的 API(日历、驱动器等)。所以每个 API 都有自己的限制。
而且,对于谷歌日历,还有另一个限制:
Cannot perform operations on different calendars in the same batch request.
(错误“400 错误请求”,原因“cannotOperateOnDifferentCalendarsInBatch”)
关于google-api - 针对不同 API 和限制的 Google API 和批处理请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30098807/