2013-07-02 67 views

回答

1

下面的批處理請求,獲取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-- 
+0

什麼是要用於批處理請求的完整網址。我嘗試使用「http://www.googleapis.com/batch」,但它失敗了...請讓我知道 – Jagadeesh

+0

端點是:http://www.googleapis.com/batch – ade

0

端點是

https://www.googleapis.com/batch

這對我來說,當我做日曆批量請求工作。我遇到的一個問題是我的最後一個邊界令牌後面沒有--。所以每個令牌最後都以--開頭,最後一個令牌爲--。正如@Burcu Dogan的例子所示。