title: Using Zend_Http_Client to send json POST
body: <p>I'm trying to send a json object as a POST command using the following:</p>
  
  <pre><code>    $uri = "http://amore-luce.com/product_create";
      $product =  $observer-&gt;getEvent()-&gt;getProduct();
      $json = Mage::helper('core')-&gt;jsonEncode($product);
      Mage::log(" Json={$json}", null,'product-updates.txt');
  
      // new HTTP request to some HTTP address
      $client = new Zend_Http_Client('http://amore-luce.com/product_create');
      // set some parameters
      $client-&gt;setParameterPost('product', $json);
      // POST request
      $response = $client-&gt;request(Zend_Http_Client::POST);
  </code></pre>
  
  <p>When I view the $json the data is  there and all looks good - however the POST is not sending the json data. I'm capturing it using a simple email form that should send me the response:</p>
  
  <pre><code>    &lt;?php        
      $webhookContent = "";
      $ref = "";       
      $webhook = fopen('php://input' , 'rb');
      while (!feof($webhook)) {
          $webhookContent .= fread($webhook, 4096);
      }
      fclose($webhook);
  
       $headers = array();
          foreach($_SERVER as $key =&gt; $value) {
              if (substr($key, 0, 5) &lt;&gt; 'HTTP_') {
                  continue;
              }
              $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
              $headers[$header] = $value;
          }
  
      foreach ($headers as $header =&gt; $value) {
          $ref .= "$header: $value &lt;br /&gt;\n";
      }
  
      $post = file_get_contents('php://input');
      $to = "address@my-email.com"; //the address the email is being sent to
      $subject = "This is the subject"; //the subject of the message
      $msg = "This is the message  -  Webhook content:  ".$webhookContent."    This is url:  ".$ref; //the message of the email
  
      mail($to, $subject, $msg, 'From: PHP Scriptv2 &lt;noreply@domain.com&gt;'); //send the email.
  
      echo ($_SERVER['HTTP_REFERER']."&lt;br&gt;".$_SERVER['REQUEST_URI']);
      ?&gt;
  </code></pre>
  
  <p>This page works with other json POST requests I've sent to it.  I'm fairly new at sending POST requests so any help would be greatly appreciated.</p>