title: Handling HTTP headers sent with curl
body: <p>I'm currently trying to implement oAuth on a server side in order to provide an API for developers. I'm experiencing a very easy issue. I want to be able to handle HTTP headers sent to a script called request.php. </p>
  
  <p>I have no idea how I can do that. I'm a coding a wrapper for clients, and try to make http call on request.php with curl.</p>
  
  <pre><code>    $data = array('name' =&gt; 'Foo');
  
      $header = array('Content-type: text/plain', 'Content-length: 100');
      $ch = curl_init("test");
  
      curl_setopt($ch, CURLOPT_URL, 'http://localhost/api/request.php');
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  
      $res = curl_exec($ch);
  
      $headers = curl_getinfo($ch);
  
      curl_close($ch);
  </code></pre>
  
  <p>So, in $headers I received the http responses headers but what I want to do is handling headers received by request.php.</p>