title: Curl or HTTP Client - Get content before redirecting
body: <p>Using Symfony, I want to get the content of a web page using PHP. </p>
  
  <p>I tried to use Symfony HTTP Client :</p>
  
  <pre><code>        $client = new NativeHttpClient();
  
          $response = $client-&gt;request('GET', $url, [
              'max_redirects' =&gt; 0,
          ]);
  
          $content = $response-&gt;getContent();
  </code></pre>
  
  <p>But I have an error because I have a redirection. I tried using classic CuRL PHP using this option :</p>
  
  <pre><code>        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
  </code></pre>
  
  <p>But I can't get the content, it return <code>true</code>.</p>
  
  <p>So for now, only <code>file_get_contents()</code> works, but I need to pass Cookie file and it's not really POO..</p>
  
  <p>Is there a way to get the content before a 301 redirect using CuRL ?</p>