Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Google日历API导致HTTP错误500_Php_Google Api_Google Calendar Api - Fatal编程技术网

Php Google日历API导致HTTP错误500

Php Google日历API导致HTTP错误500,php,google-api,google-calendar-api,Php,Google Api,Google Calendar Api,我正在使用新的谷歌日历API v3。我正在尝试使用PHP库获取用户日历列表。如果我直接使用CURL发出请求,那么它可以正常工作,但由于某种原因,当我尝试使用PHP库时,它失败并抛出500个错误。 以下是(缩写)代码: 如果我var_转储$this->calendarAPI->calendarList的内容,那么我会得到一个我期望的对象。只有当我调用list方法时,才会出现问题 有人能帮忙吗?或者我必须编写自己的库并直接与API协议交互吗?好的,所以文档中发现这是一个错误。您必须调用listCal

我正在使用新的谷歌日历API v3。我正在尝试使用PHP库获取用户日历列表。如果我直接使用CURL发出请求,那么它可以正常工作,但由于某种原因,当我尝试使用PHP库时,它失败并抛出500个错误。 以下是(缩写)代码:

如果我var_转储$this->calendarAPI->calendarList的内容,那么我会得到一个我期望的对象。只有当我调用list方法时,才会出现问题


有人能帮忙吗?或者我必须编写自己的库并直接与API协议交互吗?

好的,所以文档中发现这是一个错误。您必须调用listCalendarList()而不是调用名为list()的方法,因此第二行应该是:

 $calendar_list = $this->calendarAPI->calendarList->listCalendarList();
 $calendar_list = $this->calendarAPI->calendarList->listCalendarList();