title: Bad Request on PHP Curl
body: <p>I am having issues with PHP curl commands using custom headers.  Can anyone see what is happening here?</p>
  
  <pre><code>  $url = "https://api.sitescout.com/oauth/token";
    $ch = curl_init();
  
    $headers  = array(
      "POST https://api.sitescout.com/oauth/token HTTP/1.1",
      "Host: api.sitescout.com",
      "Authorization: Basic bGFtcGhvdXNlLWFwaTp2RmhsSmlJMm5BT****",
      "Content-Type: application/x-www-form-urlencoded",
      "Accept: application/json",
      "Content-Length: 41"
    );
  
    $post_fields = array(
      'grant_type' =&gt; 'client_credentials'
    );
  
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
  
  print_r($output);
  
    curl_close($ch);
  
    //var_dump($output);
  </code></pre>
  
  <p>Here is the server response.</p>
  
  <p>HTTP/1.1 400 Bad Request
  Server: Apache-Coyote/1.1
  Date: Mon, 10 Feb 2014 05:13:09 GMT
  Connection: close</p>
  
  <p>Any help would be greatly appreciated!!</p>