title: POST JSON data via CURL and grabbing it
body: <p>I am trying to pass a json data as param for cURL POST. However, I am stuck at grabbing it and saving it on db.</p>
  
  <p>cURL file:</p>
  
  <pre><code>$data = array("name" =&gt; "Hagrid", "age" =&gt; "36");                                                                    
  $data_string = json_encode($data);                                                                                   
  
  $url = 'http://localhost/project/test_curl';
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
                                      'Content-Type: application/json')                                                                                           
                                      );                       
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                                                     
  
  $result = curl_exec($ch);  
  
  //based on http://www.lornajane.net/posts/2011/posting-json-data-with-php-curl
  </code></pre>
  
  <p>test_curl file:</p>
  
  <pre><code>    $order_info = $_POST; // this seems to not returning anything
  
      //SAVE TO DB... saving empty...
  </code></pre>
  
  <p>What did I miss? Weew....</p>