title: php curl post not sending data
body: <p>I am trying to send POST data:</p>
  
  <pre><code>$url ="https://server:510/1/auth/";
  
  $data = array(
        "USERNAME" =&gt; "user",
        "PASSWORD" =&gt; "password"
   );
  
  $str_data = json_encode($data);
  
  $ch = curl_init( $url );
  curl_setopt( $ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER,
  array('Content-Type:application/json',
      'Content-Length: ' . strlen($str_data))
  ); 
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $str_data);
  curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch,CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
  curl_setopt($ch,CURLOPT_POSTREDIR,3);
  $response = curl_exec( $ch );
  print_r($response);
  </code></pre>
  
  <p>and the server response is(result of verbose): 
  "you haven't sent any credentials"</p>
  
  <pre><code>&gt; POST /1/auth/ HTTP/1.1
  Host: server:port
  Accept: */*
  Content-Length: 39
  Content-Type: application/x-www-form-urlencoded
  
  &lt; HTTP/1.1 200 OK
  &lt; Date: Mon, 06 Jul 2015 18:53:52 GMT
  &lt; Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1i mod_wsgi/3.5 Python/2.7.8
  &lt; Content-Length: 73
  &lt; Content-Type: application/json
  &lt; 
  </code></pre>
  
  <p>it seems like i am not sending post data. what am i missing?</p>
  
  <p>i have noticed that in chrome debugger, under network, the request is sent as a GET....</p>
  
  <p>below is the documentation from server vendor:</p>
  
  <p>For example, suppose your server is hosted at 10.211.55.3. To request a session token provide your username and password as POSTING variables in the following URL (note the use of the /1/, which is the API version number):</p>
  
  <pre><code>https://10.211.55.3/1/auth
  USERNAME  = 'api@domain.com'
  PASSWORD  = 'Tester01'
  </code></pre>
  
  <p>thats it :(</p>