如何通过 V3 REST API 使用批量请求获取/添加/更新 Google 日历事件?我已经尝试过但没有用。根据文档 ( https://developers.google.com/google-apps/calendar/batch ),应该可以通过向 API 发布多部分/混合内容类型消息来发送批处理请求。一个有效的 HTTP POST 示例会很棒。
谢谢, 里亚兹
最佳答案
我发现外层网址一定是"https://www.googleapis.com/batch/calendar/v3/" 并且边界 url 必须是 "/calendar/v3/calendars/{calendarID}/events"
完整的 HTTP 请求如下所示:
POST /batch/calendar/v3 HTTP/1.1
Authorization: /*Auth token*/
Host: host
Content-Type: multipart/mixed; boundary=batch_foobarbaz
Content-Length: total_content_length
--batch_foobarbaz
Content-ID: 1
GET /calendar/v3/calendars/{calendarID1}/events
--batch_foobarbaz
Content-ID: 2
GET /calendar/v3/calendars/{calendarID2}/events
--batch_foobarbaz--
关于http - Google Calendar V3 REST API 中的批量请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17425934/