【问题标题】:Error 403 403.4 in uploading to Google Docs using Zend使用 Zend 上传到 Google Docs 时出现错误 403 403.4
【发布时间】:2012-07-10 07:29:50
【问题描述】:

我尝试在 Zend Gdata 演示中使用 google docs 示例并收到以下错误:

致命错误:未捕获的异常“Zend_Gdata_App_HttpException”与 消息“预期响应代码 200,需要 403 403.4 SSL” F:\PHP_libs\Zend\Gdata\App.php:714 堆栈跟踪:#0 F:\PHP_libs\Zend\Gdata.php(219): Zend_Gdata_App->performHttpRequest('GET', 'http://docs.goo...', Array, NULL, NULL, NULL) #1 F:\PHP_libs\Zend\Gdata\App.php(880): Zend_Gdata->performHttpRequest('GET', 'http://docs.goo...', Array) #2 F:\PHP_libs\Zend\Gdata\App.php(768): Zend_Gdata_App->get('http://docs.goo...', NULL) #3 F:\PHP_libs\Zend\Gdata\App.php(210): Zend_Gdata_App->importUrl('http://docs.goo...', 'Zend_Gdata_Docs...', NULL) #4 F:\PHP_libs\Zend\Gdata.php(162): Zend_Gdata_App->getFeed('http://docs.goo...', 'Zend_Gdata_Docs...') #5 F:\PHP_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_libs\Zend\Gdata\App.php 中检索WPD

我第一次使用 Zend 库,无法弄清楚授权是如何在这里工作的。请帮忙

【问题讨论】:

    标签: api zend-framework doc


    【解决方案1】:

    我不确定这是否在最新版本的 Zend 库中得到修复,但我在我的 Zend 安装中更新了这个文件: 库/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';
    

    成功了。

    【讨论】:

      【解决方案2】:

      如果您想连接到 GoogleDocs,则必须使用 https 而不是 http,这在您收到的错误消息中说明:Expected response code 200, got 403 403.4 SSL required。消息的部分解释如下:

      • Expected response code 200:被调用的方法期望http响应码为200
      • got 403:实际收到的http代码
      • 403.4 SSL required:代码的简短描述

      查看List of HTTP status codes 以获取更多信息。

      Zend Framework: Documentation: Using Google Documents List Data API - Zend Framework Manual 中的示例不是最新的,应该是这样的:

      $feed = $docs->getDocumentListFeed(
          'https://docs.google.com/feeds/documents/private/full/-/document');
      

      【讨论】:

        猜你喜欢
        • 2011-05-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-03
        • 1970-01-01
        • 1970-01-01
        • 2021-11-08
        • 1970-01-01
        相关资源
        最近更新 更多