Google Docs API将资源添加到集合(Zend / gdata) [英] Google Docs API Adding a ressource to a collection (Zend/gdata)
问题描述
我试图在API文档之后执行此操作:
https://developers.google.com/google-apps/documents-list/#adding_a_resource_to_a_collection
使用Zend PHP gdata Framework我的代码是:
$ docs-> insertDocument($ entryFile,'https://docs.google.com/feeds/default/私人/充满/文件夹%3A0B - 锌 - zouTFrOXdrV3lRelhuNHM /内容);
我不知道如何找到正确的URI,然后...
entryFile参数是正确的类型,它是导致错误问题的url
来自服务器的响应:
HTTP / 1.1 400错误请求内容类型:text / html; charset = UTF-8日期:
2012年4月25日星期三17:10:51 GMT过期时间:2012年4月25日星期三17:10:51 GMT
Cache-control:private,max-age = 0 X-content-type-options:nosniff
X-frame-options:SAMEORIGIN X-xss-protection:1; mode = block服务器:
GSE连接:关闭无效的请求URI
例外:
致命错误:在
中未捕获异常'Zend_Gdata_App_HttpException'与
消息'预期响应代码200,得到400无效请求URI'C:\Program文件
(x86)\ EasyPHP-5.3.6.1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Program Files
(x86)\ EasyPHP-5.3.6.1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'https://docs.go ...',
Array,'performHttpRequest('POST','https://docs.go ...',Array,
'post(Object( Zend_Gdata_Docs_DocumentListEntry),
'https://docs.go ...',NULL,NULL,Array)#3 C:\程序文件
(x86)\ EasyPHP-5.3.6.1\ www\workspace\library\Zend\Gdata\Docs.php(30 0):
Zend_Gdata_App-> insertEntry(Object(Zend_Gdata_Docs_DocumentListEntry),
'https://docs.go ...','Zend_Gdata_Docs .. in C:\ Program Files
( x86)\EasyPHP-5.3.6.1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$ b(如果您需要任何信息,请让我知道,我真的停留在这一点上,如果需要,我愿意尽可能多地提供详细信息)
解决方案使用Google云端硬盘SDK的Php客户端库解决了问题
I'm trying to do this following the API documentation there: https://developers.google.com/google-apps/documents-list/#adding_a_resource_to_a_collection
With the Zend PHP gdata Framework my code is :
$docs->insertDocument($entryFile, 'https://docs.google.com/feeds/default/private/full/folder%3A0B--Zn-zouTFrOXdrV3lRelhuNHM/contents');
I don't know how to find the correct URI then...
The entryFile parameter is the right type, it's the url that cause the problem the error
Response from the server :
HTTP/1.1 400 Bad Request Content-type: text/html; charset=UTF-8 Date: Wed, 25 Apr 2012 17:10:51 GMT Expires: Wed, 25 Apr 2012 17:10:51 GMT Cache-control: private, max-age=0 X-content-type-options: nosniff X-frame-options: SAMEORIGIN X-xss-protection: 1; mode=block Server: GSE Connection: close Invalid request URI
The exception :
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Invalid request URI' in C:\Program Files (x86)\EasyPHP-5.3.6.1\www\workspace\library\Zend\Gdata\App.php:709 Stack trace: #0 C:\Program Files (x86)\EasyPHP-5.3.6.1\www\workspace\library\Zend\Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', 'https://docs.go...', Array, 'performHttpRequest('POST', 'https://docs.go...', Array, 'post(Object(Zend_Gdata_Docs_DocumentListEntry), 'https://docs.go...', NULL, NULL, Array) #3 C:\Program Files (x86)\EasyPHP-5.3.6.1\www\workspace\library\Zend\Gdata\Docs.php(300): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Docs_DocumentListEntry), 'https://docs.go...', 'Zend_Gdata_Docs.. in C:\Program Files (x86)\EasyPHP-5.3.6.1\www\workspace\library\Zend\Gdata\App.php on line 709
(If you need any info please let me know, i'm really stuck on this and i'm willing to give as much details as possible if needed)
解决方案I solved the problem using the Php Client Library for the Google Drive SDK
这篇关于Google Docs API将资源添加到集合(Zend / gdata)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!