title: Google APIs Client Library for PHP 1.0.0 download not working
body: <p>Having been unsucessful at downloading a file from Google Drive using version 0.6, I have tried to convert the following function to work with the 1.0.0 alpha of the Google APIs Client Library for PHP.  One line in particular that I am unsure about is the one with the call to getAuth().  It is returning an object that has an empty http code response.  I have included the response below.  Can anyone give me a pointer as to what I am doing wrong?</p>
  
  <p>BTW, the $service object (that results from the authorization) is good because I use it to get a list of the files with no problem.</p>
  
  <pre><code>function GetFile($service, $fileId) {
     $fileVars = null;
     try {
        $file = $service-&gt;files-&gt;get($fileId);
        $fileVars = get_object_vars($file);
        $downloadUrl = $file-&gt;getDownloadUrl();
  
        if ($downloadUrl) {
           $client = $service-&gt;getClient();
           $request = new Google_Http_Request($client, $downloadUrl, 'GET', null, null);
           $httpRequest = $client-&gt;getAuth()-&gt;sign($request);
           drupal_set_message(t("Google_Http_Request: &lt;pre&gt;@status&lt;/pre&gt;", array('@status' =&gt; print_r($httpRequest, TRUE))));
           error_log(print_r($httpRequest, 1));
  
           if ($httpRequest-&gt;getResponseHttpCode() == 200) {
              $content = $httpRequest-&gt;getResponseBody();
              $fileVars['content'] = $content?($content):'';
           } else {
              // An error occurred.
              return null;
           }
        } else {
           // The file doesn't have any content stored on Drive.
           return null;
        }
  
     } catch (apiServiceException $e) {
        error_log('Error retrieving file from Drive: ' . $e-&gt;getMessage());
        throw $e;
     }
     return json_encode($fileVars);
  }
  
  Google_Http_Request Object
  (
      [batchHeaders:Google_Http_Request:private] =&gt; Array
          (
              [Content-Type] =&gt; application/http
              [Content-Transfer-Encoding] =&gt; binary
              [MIME-Version] =&gt; 1.0
          )
  
      [baseUrl:protected] =&gt; https://doc-10-50-docs.googleusercontent.com/docs/securesc/apic76cj8gku48a9ogarn9khpku0s46q/8pk7jcqiirj9bu21a9u2mqa6lmo1887p/1386864000000/08295678552528470768/15372451357194678536/0B6ahcE1NPpIaNE1wRU9TbW1LVU0
      [queryParams:protected] =&gt; Array
          (
              [h] =&gt; 16653014193614665626
              [e] =&gt; download
              [gd] =&gt; true
          )
  
      [requestMethod:protected] =&gt; GET
      [requestHeaders:protected] =&gt; Array
          (
              [authorization] =&gt; Bearer ya29.1.AADtN_V-6HHMTghP6EFc3DD1Ktf3wFyQtxscciNyyJzlu36YPG_oC7iX565RctWgCl9MQ4tB1Q
          )
  
      [postBody:protected] =&gt; 
      [userAgent:protected] =&gt;  google-api-php-client/1.0.1-alpha
      [responseHttpCode:protected] =&gt; 
      [responseHeaders:protected] =&gt; 
      [responseBody:protected] =&gt; 
      [expectedClass:protected] =&gt; 
      [client:protected] =&gt; Google_Client Object
          (
              [auth:Google_Client:private] =&gt; Google_Auth_OAuth2 Object
                  (
                      [assertionCredentials:Google_Auth_OAuth2:private] =&gt; 
                      [state:Google_Auth_OAuth2:private] =&gt; 
                      [token:Google_Auth_OAuth2:private] =&gt; Array
                          (
                              [access_token] =&gt; xxx
                              [token_type] =&gt; Bearer
                              [expires_in] =&gt; 3552
                              [created] =&gt; 1386868612
                          )
  
                      [client:Google_Auth_OAuth2:private] =&gt; Google_Client Object
   *RECURSION*
                  )
  
              [io:Google_Client:private] =&gt; Google_IO_Stream Object
                  (
                      [client:protected] =&gt; Google_Client Object
   *RECURSION*
                  )
  
              [cache:Google_Client:private] =&gt; 
              [config:Google_Client:private] =&gt; Google_Config Object
                  (
                      [configuration:Google_Config:private] =&gt; Array
                          (
                              [application_name] =&gt; 
                              [auth_class] =&gt; Google_Auth_OAuth2
                              [io_class] =&gt; Google_IO_Stream
                              [cache_class] =&gt; Google_Cache_File
                              [base_path] =&gt; https://www.googleapis.com
                              [classes] =&gt; Array
                                  (
                                      [Google_Auth_OAuth2] =&gt; Array
                                          (
                                              [client_id] =&gt; xxx
                                              [client_secret] =&gt; xxx
                                              [redirect_uri] =&gt; http://flashum.com/goauth/authenticate
                                              [developer_key] =&gt; 
                                              [access_type] =&gt; online
                                              [approval_prompt] =&gt; auto
                                              [request_visible_actions] =&gt; 
                                              [federated_signon_certs_url] =&gt; https://www.googleapis.com/oauth2/v1/certs
                                          )
  
                                      [Google_Cache_File] =&gt; Array
                                          (
                                              [directory] =&gt; C:\Users\CDAVID~1\AppData\Local\Temp/Google_Client
                                          )
  
                                  )
  
                              [services] =&gt; Array
                                  (
                                  )
  
                          )
  
                  )
  
              [deferExecution:Google_Client:private] =&gt; 
              [availableScopes:protected] =&gt; Array
                  (
                      [drive] =&gt; Array
                          (
                              [0] =&gt; https://www.googleapis.com/auth/drive
                              [1] =&gt; https://www.googleapis.com/auth/drive.apps.readonly
                              [2] =&gt; https://www.googleapis.com/auth/drive.readonly
                              [3] =&gt; https://www.googleapis.com/auth/drive.file
                              [4] =&gt; https://www.googleapis.com/auth/drive.scripts
                              [5] =&gt; https://www.googleapis.com/auth/drive.metadata.readonly
                              [6] =&gt; https://www.googleapis.com/auth/drive.appdata
                          )
  
                  )
  
              [requestedScopes:protected] =&gt; Array
                  (
                      [0] =&gt; https://www.googleapis.com/auth/drive
                  )
  
              [services:protected] =&gt; Array
                  (
                  )
  
              [authenticated:Google_Client:private] =&gt; 
          )
  
      [accessKey] =&gt; 
      [basePath:Google_Http_Request:private] =&gt; https://www.googleapis.com
  )
  </code></pre>