【发布时间】:2013-07-24 07:15:06
【问题描述】:
我正在尝试通过批量请求向 Google 日历发送一堆事件。 但我不知道该怎么做。 https://developers.google.com/google-apps/calendar/batch 帮不了我。
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_CalendarService.php';
$client = new Google_Client();
$client->setUseBatch(true);
$batch = new Google_BatchRequest();
$uri = 'http://www.google.com/calendar/feeds/default/private/full/batch';
$batchContent = file_get_contents('xxxxx/google-api-php-client/batch.xml');
$batch->add($batchContent);
batch.xml 包含 2 个项目。 到目前为止就是这样。但是什么也没发生。
我也试过
$batch->execute()
但这会引发没有消息的错误。
我的问题:如何通过 PHP 将批次发送到 Google 日历?
【问题讨论】:
标签: php google-calendar-api google-api-php-client google-api-client