如何通過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