title: Google Drive API download file, http respond code 200 but the responseBody is empty
body: <p>Sorry if this is a stupid question but I´m new here and I don´t know how to follow.</p>
  
  <p>I´ve implemented the support of Google drive in our server in php that provides support to our apps in Android and IOs, we can upload files to Google Drive or delete them with no issues, and when we are downloading the file, it looks like the httpResponseCode is correct 200 and the responseHeader too but the responseBody is empty.</p>
  
  <p>I put here the response from Google Drive Server in case someone has any idea. thanks</p>
  
  <pre><code> apiHttpRequest Object
     (
          [batchHeaders:apiHttpRequest:private] =&gt; Array
              (
                  [Content-Type] =&gt; application/http
                  [Content-Transfer-Encoding] =&gt; binary
                  [MIME-Version] =&gt; 1.0
                  [Content-Length] =&gt; 
              )
  
          [url:protected] =&gt; https://doc-0s-6s-docs.googleusercontent.com/docs/securesc/3h10lch354ufu4pkrusuk27smk7k4ifq/qp3b555lfchhfmpfodjv4mcpbug1vol6/1346112000000/12488086635796486161/12488086635796486161/0B_cf3F02DuErM3V3b0o4WnYyNTA?h=16653014193614665626&amp;e=download&amp;gd=true
          [requestMethod:protected] =&gt; GET
          [requestHeaders:protected] =&gt; Array
              (
                  [authorization] =&gt; Bearer ya29.AHES6ZQwIuu8ZhP8Uk389Sgo5NELnvArjzAC362ByzEsh2qa_gjDvJw
              )
  
          [postBody:protected] =&gt; 
          [userAgent:protected] =&gt; google-api-php-client/0.5.0
          [responseHttpCode:protected] =&gt; 200
          [responseHeaders:protected] =&gt; Array
              (
                  [server] =&gt; HTTP Upload Server Built on Aug 15 2012 18:03:01 (1345078981)
                  [access-control-allow-origin] =&gt; *
                  [access-control-allow-credentials] =&gt; false
                  [access-control-allow-headers] =&gt; authorization
                  [access-control-allow-methods] =&gt; GET,OPTIONS
                  [content-type] =&gt; video/quicktime
                  [content-disposition] =&gt;  attachment;filename="VID_20120827_105737.mp4";filename*=UTF-8''VID_20120827_105737.mp4
                  [content-length] =&gt; 2768422
                  [date] =&gt; Tue, 28 Aug 2012 00:15:26 GMT
                  [expires] =&gt; Tue, 28 Aug 2012 00:15:26 GMT
                  [cache-control] =&gt; private, max-age=0
              )
  
          [responseBody:protected] =&gt;
  </code></pre>
  
  <p>Now the code that I´m using:</p>
  
  <pre><code>   public function GetFile($fileId) {
       $fileVars = null;
       try {
         /*
          * Retrieve metadata for the file specified by $fileId.
          */
         $file = $this-&gt;service-&gt;files-&gt;get($fileId);
         $fileVars = get_object_vars($file);
  
         /*
          * Retrieve the file's content using download URL specified in metadata.
          */
         $downloadUrl = $file-&gt;getDownloadUrl();
         error_log('Download URL file from Drive: ' . $downloadUrl);
         if ($downloadUrl) {
           $request = new apiHttpRequest($downloadUrl, 'GET', null, null);
           $httpRequest = apiClient::$io-&gt;authenticatedRequest($request);
           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) {
         /*
          * Log error and re-throw
          */
         error_log('Error retrieving file from Drive: ' . $e-&gt;getMessage());
         throw $e;
       }
       return json_encode($fileVars);
      }
  </code></pre>