2013-07-02 64 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的例子所示。