gpt4 book ai didi

php - 网址错误 0 : The cURL request was retried 3 times and did not succeed

转载 作者:太空宇宙 更新时间:2023-11-03 15:28:59 27 4
gpt4 key购买 nike

我正在开展一个托管在 Google App Engine 上的项目,并使用 app_devserver 进行本地开发。一开始我遇到了证书问题,但是当我终于克服了这个错误时,我得到了这个新错误

我正在使用 Windows 10 和 PHPstorm 进行开发。

错误:

Message: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

看起来这个错误是说请求已成功发出但正文无法解析或解析?我该如何解决?

如果需要,这是我的 PHP 代码:(简单调用标签管理器 api v2)

    $client = new Google_Client();
$client->setAuthConfig('service_account.json');

$client->setApplicationName("gtmdocx");
/*$client->setScopes(['https://www.googleapis.com/auth/tagmanager.readonly',
'https://www.googleapis.com/auth/tagmanager.manage.accounts',
'https://www.googleapis.com/auth/tagmanager.edit.containers']);*/
$client->setScopes(['https://www.googleapis.com/auth/tagmanager.readonly']);
$service = new Google_Service_TagManager($client);
$results = $service->accounts->listAccounts();


echo $_GET['callback'] . '('.json_encode($results).')';

最佳答案

我在使用 Google 云端硬盘应用程序时遇到了这个问题,在尝试找到解决方案几个小时后,我使用 GuzzleHttp 接收器选项让它工作

$client = new \Google_Client();
// ... Client Configuration

$httpClient = new Client([
'sink' => 'path_to_any_temp_file',
'base_uri' => $client->getConfig('base_path'),
]);
$client->setHttpClient($httpClient);

值得一试。

关于php - 网址错误 0 : The cURL request was retried 3 times and did not succeed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46323867/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com