title: POST using cURL and x-www-form-urlencoded in PHP returning Access Denied
body: <p>I have been able to use the Advanced Rest Client Extension for chrome to send POST queries to an specific HTTPS server and I get Status Code: 200 - OK with the same body fields as the ones I used in this code, but when I run the following code I get this response: 403 - Access Denied.</p>
  
  <pre><code>&lt;?php
  $postData = array(
  'type' =&gt; 'credentials',
  'id' =&gt; 'exampleid',
  'secret_key' =&gt; 'gsdDe32dKa'
  );
  
  // Setup cURL
  $ch = curl_init('https://www.mywebsite.com/oauth/token');
  curl_setopt_array($ch, array(
  CURLOPT_POST =&gt; TRUE,
  CURLOPT_RETURNTRANSFER =&gt; TRUE,
  CURLOPT_HTTPHEADER =&gt; array('Content-Type: application/x-www-form-urlencoded'
  ),
  CURLOPT_POSTFIELDS =&gt; json_encode($postData)
  ));
  
  // Send the request
  $response = curl_exec($ch);
  
  var_dump($response);
  
  // Check for errors
  if($response === FALSE){
  die(curl_error($ch));
  }
  
  // Decode the response
  $responseData = json_decode($response, TRUE);
  
  // Print the date from the response
  echo $responseData['published'];
  ?&gt;
  </code></pre>
  
  <p>I've noticed as well that when I use Advanced Rest Client Extension for chrome and if I set the Content-Type to application/json I have to enter a login and a password that I don't know what are those because even if I enter the id and secret key that I have in the code it returns 401 Unauthorized. So I'm guessing this code that I wrote is not forcing it to the content-type: application/x-www-form-urlencoded, but I'm not sure. Thank you for any help on this issue!</p>