title: How to create droplet with digital ocean api v2?
body: <p>I want to create droplet but I am getting error in <code>curl_close()</code>. How can I create droplet ? It is giving me error like:</p>
  
  <pre><code> Warning: curl_close() expects parameter 1 to be resource 
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;?php
  $data = 'name=TestDroplet&amp;region=ams3&amp;size=512mb&amp;image=449676322';
  $create_droplet = curl_init();
  
  curl_setopt_array(
      $create_droplet, 
      array(
          CURLOPT_USERAGENT =&gt; "METESTING",
          CURLOPT_POST =&gt; 0,
          CURLOPT_URL =&gt; 'https://api.digitalocean.com/v2/droplets',
          CURLOPT_RETURNTRANSFER =&gt; true,
          CURLOPT_HTTPHEADER =&gt; array(
              'Authorization: Bearer 0503e2f686f11fb5b7f81c8baf6434b63103715422cb719711f77dde44d768a4',
              'Content-Type: application/json',
              'Content-Length: ' . strlen($data)
          ),
          CURLOPT_POSTFIELDS =&gt; $data
      )
  );
  
  $create = curl_exec($create_droplet);
  curl_close($create);
  
  echo '&lt;pre&gt;';
  print_r($create);
  echo '&lt;/pre&gt;';
  </code></pre>