如何通过V3 REST API使用批量请求获取/添加/更新Google日历事件?我试过了,但没有成功。根据文档(https://developers.google.com/google-apps/calendar/batch),应该可以通过将多部分/混合内容类型消息发布到API来发送批量请求。一个正在运行的HTTP POST的例子会很棒。Google Calendar V3 REST API中的批量请求
感谢, Riyaz
如何通过V3 REST API使用批量请求获取/添加/更新Google日历事件?我试过了,但没有成功。根据文档(https://developers.google.com/google-apps/calendar/batch),应该可以通过将多部分/混合内容类型消息发布到API来发送批量请求。一个正在运行的HTTP POST的例子会很棒。Google Calendar V3 REST API中的批量请求
感谢, Riyaz
下面的批处理请求,获取eventId1,更新eventId2并根据该标识与calendarId压延机创建一个新的事件。
POST /batch HTTP/1.1
Authorization: /*Auth token*/
Host: host
Content-Type: multipart/mixed; boundary=batch_foobarbaz
Content-Length: total_content_length
--batch_foobarbaz
Content-Type: application/http
Content-ID: <item1:[email protected]>
GET /calendar/v3/calendars/calendarId/events/eventId1
--batch_foobarbaz
Content-Type: application/http
Content-ID: <item2:[email protected]>
PUT /calendar/v3/calendars/calendarId/events/eventId2
Content-Type: application/json
Content-Length: part_content_length
{{ body }}
--batch_foobarbaz
Content-Type: application/http
Content-ID: <item3:[email protected]>
POST /calendar/v3/calendars/calendarId/events
Content-Type: application/json
Content-Length: part_content_length
{{ body }}
--batch_foobarbaz--
端点是
https://www.googleapis.com/batch
这对我来说,当我做日历批量请求工作。我遇到的一个问题是我的最后一个边界令牌后面没有--
。所以每个令牌最后都以--
开头,最后一个令牌为--
。正如@Burcu Dogan的例子所示。
什么是要用于批处理请求的完整网址。我尝试使用“http://www.googleapis.com/batch”,但它失败了...请让我知道 – Jagadeesh
端点是:http://www.googleapis.com/batch – ade