title: HTTP Post request from PHP to NodeJs Server
body: <p>I tried to make a request to my nodeJS using CURL from PHP.
  Here is my code:</p>
  
  <pre><code>$host = 'http://my_ip:8080/ping';
  $json = '{"id":"13"}';
  
  $ch = curl_init($host);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
              'Content-Type: application/json',
              'Content-Length: ' . strlen($json))
      );
  $data = curl_exec($ch);
  var_dump($data);
  </code></pre>
  
  <p>But it doesn't work. I received bool(FALSE) in data var.</p>
  
  <p>NodeJS:</p>
  
  <pre><code>app.use(router(app));
  app.post('/ping', bodyParser, ping);
  port = 8080;
  app.listen(port, webStatus(+port));
  function* ping() {
      console.log(this.request.body);
      this.body = 1;
  }
  </code></pre>
  
  <p>I tried with NodeJS Http-post and it works:</p>
  
  <pre><code>http.post = require('http-post');
  http.post('http://my_ip:8080/ping', { id: '13' }, function (res) {
      res.on('data', function (chunk) {
          console.log(chunk);
      });
  });
  </code></pre>
  
  <p>Is it something wrong with PHP code?</p>
  
  <p>PS: The CURL is included in PHP.</p>