I'm trying to download or convert a file from Google Drive. I am using the below code, and I get the error "Class 'Google_Http_Request' not found". I can't seem to find what I'm missing. Am I missing something? A required file?
I'm using php-google-api-php-client (0.6.2-1) [universe].
Thanks.
$file = $service->files->get($drive_id);
//if actual file
//$downloadUrl = $file->getDownloadUrl();
//if a google doc
$downloadUrl = $file->getExportLinks();
if ($downloadUrl) {
$request = new Google_Http_Request($downloadUrl, 'GET', null, null);
$httpRequest = $service->getClient()->getAuth()->authenticatedRequest($request);
if ($httpRequest->getResponseHttpCode() == 200) {
return $httpRequest->getResponseBody();
} else {
// An error occurred.
return null;
}
} else {
// The file doesn't have any content stored on Drive.
return null;
}