2016-02-23 176 views
-1

它不起作用的下載文件。文檔https://developers.google.com/drive/v2/web/manage-downloads谷歌驅動器api v2 php

的功能寫入:,

這裏https://github.com/google/google-api-php-client/blob/master/UPGRADING.md 這是寫的是Removed Google_Http_Request

如果您使用的相似,它改變成一個GET請求,並替換的鏈接,如上面

$httpClient = $client->authorize(); 
$request = new GuzzleHttp\Psr7\Request('POST', $url); 
$response = $httpClient->send($request); 

中的最後一個環節描述寫入:

Argument 1 passed to GuzzleHttp\Client::send() must implement interface GuzzleHttp\Message\RequestInterface, instance of GuzzleHttp\Psr7\Request given, called in \file.php on line 37 and defined in \vendor\guzzlehttp\guzzle\src\Client.php on line 158 

那些誰經歷過這一點?任何解決問題的辦法?

回答

0

我遇到了與Google雲端存儲php API相同的問題。試着這樣說:

$httpClient = $client->authorize(); 
$response = $httpClient->get($url); 

,然後如果你需要傾倒出來的瀏覽器(比如,你要檢索圖像):

echo $response->getBody();