title: Drupal : curl call + view file pdf
body: <p>I would like to make a curl call to another server to retrieve a pdf file
  Then I want to view this file on my Drupal website.
  But there is one problem: We can not change the header in the Drupal Module !</p>
  
  <pre><code>$CurlConnect = curl_init();
          $fields = array(
                                  'param1' =&gt; $p1,
                                  'param2' =&gt; $p2,
                          );
  
      $fields_string = '';
          foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;'; }
          rtrim($fields_string, '&amp;');
          curl_setopt($CurlConnect, CURLOPT_URL, 'http://test....');
          curl_setopt($CurlConnect, CURLOPT_POST,   1);
          curl_setopt($CurlConnect, CURLOPT_RETURNTRANSFER, 1 );
          curl_setopt($CurlConnect, CURLOPT_POSTFIELDS, $fields_string);
          $Result = curl_exec($CurlConnect);
  
          header('Cache-Control: public'); 
          header('Content-type: application/pdf');
  
          header('Content-Disposition: inline; filename="fichier.pdf"');
  
          header('Content-Length: '.strlen($Result));
  
          echo $Result;
  </code></pre>