title: Cannot receive data submitted using curl in post method using php
body: <p>I been trying to pass data using post and curl in php and this is the code that will receive the data</p>
  
  <pre><code>&lt;?php
  # required headers
  header("Access-Control-Allow-Origin: *");
  header("Content-Type: application/json; charset=UTF-8");
  header("Access-Control-Allow-Methods: POST");
  header("Access-Control-Max-Age: 3600");
  header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
  
  # include database and object files
  require_once "vendor/autoload.php";
  
  use \Database\Db as Db;
  use \Objects\Leads as Leads;
  
  # get database connection
  $database = new Db();
  $database-&gt;Connect(
    getenv('DB_CONNECTION'),
    getenv('DB_DATABASE'),
    getenv('DB_USERNAME'),
    getenv('DB_PASSWORD'),
    getenv('DB_HOST')
  );
  
  # prepare product object
  $leads = new Leads($database);
  
  # get id of product to be edited
  $fp = fopen('php://input', 'r');
  $data = stream_get_contents($fp);
  
  echo "&lt;pre&gt;";
  print_r($rawData);
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>and this is the code that send data</p>
  
  <pre><code>    $param = [
        'id'         =&gt; $result['id'],
        'transfered' =&gt; true
      ];
  
      $param = json_encode($param);
      $r = self::postSubmit($this-&gt;url . 'store.php', $param);
      dump($r);
  </code></pre>
  
  <p>and the functions code</p>
  
  <pre><code>  public function postSubmit($url, $param)
    {
      $ch = curl_init( $url );
      curl_setopt( $ch, CURLOPT_POST, 1);
      curl_setopt( $ch, CURLOPT_POSTFIELDS, $param);
      curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
      curl_setopt( $ch, CURLOPT_HEADER, 0);
      curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
  
      return curl_exec($ch);
    }
  </code></pre>
  
  <p>but when i try to run the code to see the result</p>
  
  <p>the result just <code>""</code>
  and in the database nothing has changed</p>
  
  <p>Am i doing wrong with the code?</p>