我正在使用 google-api-php-client 在拉队列中插入数据,但我遇到了错误
错误:致命错误:未捕获的异常 'google\appengine\runtime\CurlLiteOptionNotSupportedException' 带有消息 'Option 20056 is not supported by this curl implementation。在 /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): 谷歌\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。
我的代码是:
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);