title: PHP cURL sending empty parameters
body: <p>cURL is new to me. I'm trying to integrate an api via PHP cURL. The api that I'm trying to access requires that parameters be sent as key-value pairs, not json. Their example cURL request in their docs is:</p>
  
  <pre><code>curl -i -X POST -d  'api_key=my_api_key' -d 
  'email=john@doe.com' -d "first_name=Joe" -d "last_name=Doe" -d 
  "cust_id=cus_401" 
  https://serviceurl.com/api/create
  </code></pre>
  
  <p>My code is apparently sending empty parameters to their api.</p>
  
  <pre><code>    $service_url = 'https://serviceurl.com/api/create';
  
      $curl = curl_init($service_url);
  
      $email = $this-&gt;session-&gt;userdata('email');
  
      $postArray = array(
          'api_key' =&gt; 'my_api_key',
          'email' =&gt; $email,
      );
  
      $curl_post_data = $postArray;
      curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_POST, true);
  
  
      $curl_response = curl_exec($curl);
      if ($curl_response === false) {
          $info = curl_getinfo($curl);
          curl_close($curl);
          die('error occured during curl exec. Additioanl info: ' . var_export($info));
      }
      curl_close($curl);
      echo $curl_response;
      echo $info;
  </code></pre>
  
  <p>Any advice would be greatly appreciated.</p>