title: Trying out OAuth2 via CURL - The grant type was not specified in the request
body: <p>I am trying to use CURL on my terminal to perform a OAuth client:</p>
  
  <pre><code>curl -X POST -d "client_id=Barn Coop Farm&amp;amp;client_secret=b9c186fff02a3c40ffbe336017370ced&amp;amp;grant_type=client_credentials" http://coop.apps.knpuniversity.com/token
  </code></pre>
  
  <p>but I have this error below from the server:</p>
  
  <pre><code>{"error":"invalid_request","error_description":"The grant type was not specified in the request"}
  </code></pre>
  
  <p>But if I use PHP CURL:</p>
  
  <pre><code>$params = array();
  $params['grant_type'] = 'client_credentials';
  $params['client_id'] = 'Barn Coop Farm';
  $params['client_secret'] = 'b9c186fff02a3c40ffbe336017370ced';
  
  $url = 'http://coop.apps.knpuniversity.com/token';
  
  $ch = curl_init();
  $header = array ();
  curl_setopt( $ch, CURLOPT_URL, $url );
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  
  curl_setopt( $ch, CURLOPT_POSTFIELDS,$params);
  
  $response = curl_exec( $ch );
  echo $response;
  </code></pre>
  
  <p>I get the correct response:</p>
  
  <pre><code>{"access_token":"95d07fbb9964d567493c7517c25acde8a8b43ab6","expires_in":86400,"token_type":"Bearer","scope":"eggs-collect"}
  </code></pre>
  
  <p>Any ideas why and what have I missed?</p>