Api 使用Zend上传到Google文档时出现错误403403.4
我尝试在Zend Gdata演示中使用google docs示例,但出现以下错误: 致命错误:未捕获异常“Zend_Gdata_App_HttpException”与 消息“预期响应代码200,需要403 403.4 SSL” F:\PHP_libs\Zend\Gdata\App.PHP:714堆栈跟踪:#0 F:\PHP\u libs\Zend\Gdata.PHP(219): Zend_Gdata_应用程序->performHttpRequest('GET','http://docs.goo...,数组, NULL,NULL,NULL)#1f:\PHP_libs\Zend\Gdata\App.PHP(880): Zend_Gdata->performHttpRequest('GET','http://docs.goo...“,数组)#2 F:\PHP\u libs\Zend\Gdata\App.PHP(768): Zend_Gdata_应用程序->获取http://docs.goo...“,空)#3 F:\PHP\u libs\Zend\Gdata\App.PHP(210): Zend_Gdata_应用程序->导入http://docs.goo...“,“Zend_Gdata_Docs…”, NULL)#4 F:\PHP_libs\Zend\Gdata.PHP(162): Zend_Gdata_应用程序->getFeed('http://docs.goo...","Zend_Gdata_Docs…"#5 F:\PHP\u libs\Zend\Gdata\Docs.PHP(130): Zend_Gdata->getFeed('http://docs.goo...","Zend_Gdata_Docs."6 F:\xampp\htdocs\ZendGdata-1.11.12\demos\Zend\Gdata\Docs.php(277): Zend_Gdata_Docs->getDocumentListFeed('http://docs.goo...') #7 F:\xampp\htdocs\ZendGdata-1.11.12\demos\Zend\Gdata\Docs.php(752): 在第714行的F:\PHP\u libs\Zend\Gdata\App.PHP中检索wpdApi 使用Zend上传到Google文档时出现错误403403.4,api,zend-framework,doc,Api,Zend Framework,Doc,我尝试在Zend Gdata演示中使用google docs示例,但出现以下错误: 致命错误:未捕获异常“Zend_Gdata_App_HttpException”与 消息“预期响应代码200,需要403 403.4 SSL” F:\PHP_libs\Zend\Gdata\App.PHP:714堆栈跟踪:#0 F:\PHP\u libs\Zend\Gdata.PHP(219): Zend_Gdata_应用程序->performHttpRequest('GET','http://docs.goo.
我是第一次使用Zend library,我无法理解授权是如何工作的。请帮助如果要连接到GoogleDocs,您必须使用
https
而不是http
,错误消息中说明了这一点:预期响应代码200,需要403.4 SSL
。消息的部分解释如下:
$feed = $docs->getDocumentListFeed(
'https://docs.google.com/feeds/documents/private/full/-/document');
:被调用的方法预期http响应代码为预期响应代码200
200
:实际收到的http代码got403
:对代码的简短描述403.4需要SSL
$feed = $docs->getDocumentListFeed(
'https://docs.google.com/feeds/documents/private/full/-/document');
如果要连接到GoogleDocs,您必须使用
https
而不是http
,您收到的错误消息中说明了这一点:预期响应代码200,需要403.4 SSL
。消息的部分解释如下:
$feed = $docs->getDocumentListFeed(
'https://docs.google.com/feeds/documents/private/full/-/document');
:被调用的方法预期http响应代码为预期响应代码200
200
:实际收到的http代码got403
:对代码的简短描述403.4需要SSL
$feed = $docs->getDocumentListFeed(
'https://docs.google.com/feeds/documents/private/full/-/document');
我不确定这在最新版本的Zend library中是否已修复,但我在Zend安装中更新了此文件: library/Zend/Gdata/Docs.php 第62行周围的常量需要更新,以将http更改为https,现在在我的安装中如下所示:
const DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full';
const DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full';
const DOCUMENTS_CATEGORY_SCHEMA = 'https://schemas.google.com/g/2005#kind';
const DOCUMENTS_CATEGORY_TERM = 'https://schemas.google.com/docs/2007#folder';
这就成功了。我不确定这在最新版本的Zend library中是否已修复,但我在我的Zend安装中更新了此文件: library/Zend/Gdata/Docs.php 第62行周围的常量需要更新,以将http更改为https,现在在我的安装中如下所示:
const DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full';
const DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full';
const DOCUMENTS_CATEGORY_SCHEMA = 'https://schemas.google.com/g/2005#kind';
const DOCUMENTS_CATEGORY_TERM = 'https://schemas.google.com/docs/2007#folder';
这就成功了