我使用google-api-php-client在拉队列中插入数据,但我遇到错误

时间:2016-01-25 09:43:59

标签: php google-app-engine google-client

我使用google-api-php-client在拉队列中插入数据,但我遇到错误

  

错误:致命错误:未捕获的异常   用'google \ appengine \ runtime \ CurlLiteOptionNotSupportedException'   消息'此卷曲实现不支持选项20056。'   在   /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLite.php:487   堆栈跟踪:#0   /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLite.php(215):   google \ appengine \ runtime \ CurlLite-> setOption(20056,NULL)#1   /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLiteStub.php(1325):   google \ appengine \ runtime \ CurlLite-> setOptionsArray(Array)#2   /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLiteStub.php(1319):   curl_setopt_array(Object(google \ appengine \ runtime \ CurlLite),Array)#3   /base/data/home/apps/s~apigraymatics/1.390228445902450541/public/pull/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(77):   curl_setopt(Object(google \ appengine \ runtime \ CurlLite),20056,NULL)#4   /base/data/home/apps/s~apigraymatics/1.390228445902450541/public/pull/google-api-php-client/vendor/guzzlehttp/guzzle/sr   在   /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLite.php   在第487行

我的代码是:

require_once 'google-api-php-client/vendor/autoload.php';



$credentials_file = "file.json";
$client = new Google_Client();
$client->setScopes(['https://www.googleapis.com/auth/taskqueue']);
$client->setAuthConfig($credentials_file);  // This is your service account JSON key you need to export from the Developers Console
$project ='s~<project-name>';
$taskqueue ='<task-queue-name>';

$optParams = array();
$service = new Google_Service_Taskqueue($client);
$updated = new Google_Service_Taskqueue_Task($client);
$updated->getPayloadBase64('aGVsbG8=');
//$params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
$results = $service->tasks->insert($project,$taskqueue,$updated);
print_r($results);

0 个答案:

没有答案