title: Post the data with header in curl not working in php?
body: <p>I'm trying to create the box app users using PHP. The curl for create user as follows, and it is working on terminal</p>
  
  <pre><code>curl https://api.box.com/2.0/users \
  -H "Authorization: Bearer &lt;Access token&gt;" \
  -d '{"name": "New User", "is_platform_access_only": true}' \
  -X POST
  </code></pre>
  
  <p>Same thing I have tried with php But it is giving the following error </p>
  
  <pre><code>{"type":"error","status":400,"code":"invalid_request_parameters","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Invalid input parameters in request","request_id":"6688622675982fb5339a37"}
  </code></pre>
  
  <p>The following one I have tried</p>
  
  <pre><code>$developer_token = "TOKEN" ;
  $access_token_url = "https://api.box.com/2.0/users";
  
  $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL, $access_token_url);
  
  //Adding Parameters
  curl_setopt($ch, CURLOPT_POSTFIELDS, array(
      'name'=&gt;'NEW USER', 
      'is_platform_access_only'=&gt;'true',
       ));
  
  //Adding Header 
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Authorization: Bearer '.$developer_token
       ));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
  $response1 = curl_exec($ch);
  </code></pre>
  
  <p><strong>If I remove the Post parameters, and run with only headers it is give the result of users. But with post it is throws error.</strong></p>