title: PHP post request and unsupported_grant_type
body: <p>this is my code</p>
  
  <pre><code>$data = array(
          'grant_type'  =&gt; 'Password',
          'username'    =&gt; 'username',
          'password'    =&gt; 'pwd',
          'DeviceId'    =&gt; ''
      );
  
  
      $url = "http://test/sync/oauth/token";    
  
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_HEADER, false);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  
      $response = curl_exec($curl);
  
      $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  
      if ( $status != 201 ) {
          die("Error: call to URL $url failed with status $status, response $response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
      }
  
  
      curl_close($curl);
  
      print_r($response);`
  </code></pre>
  
  <p>I think is correct, but the server return me this error</p>
  
  <blockquote>
    <p>Error: call to URL <a href="http://test/sync/oauth/token" rel="nofollow">http://test/sync/oauth/token</a> failed with status
    400, response {"error":"unsupported_grant_type"}, curl_error ,
    curl_errno 0</p>
  </blockquote>
  
  <p>Where is the error?</p>