title: Guzzle 6.0 download file using request headers
body: <p>I can't find any example of how to download a remote file using Guzzle 6.0. I need to pass headers in the GET request.</p>
  
  <p>I have looked at the documentation which isn't helpful at all.</p>
  
  <p>I came up with this but it still doesn't download a file</p>
  
  <pre><code>require_once('vendor/autoload.php');
  
  use GuzzleHttp\Exception\GuzzleException;
  use GuzzleHttp\Client;
  
  $client = new Client();
  
  $response = $client-&gt;request('GET', '/stream/20', [
      'headers' =&gt; [
          'Authorization: Token token' =&gt; 'df456g4fd564gfs65dg45s6fdg4dsf5g4sd65g', 
          'Cache-Control' =&gt; 'no-cache', 
          'Content-Type' =&gt; 'application/pdf'
      ],
      'sink' =&gt; 'https://example.com/path/to/file',
  ]);
  </code></pre>
  
  <p>Has anyone successfully downloaded a file using request headers?</p>