title: POST request from Ruby to PHP. Unable to fetch data from the PHP page
body: <p>I am working on this Ruby console application which should send a POST request to a PHP file and then print out the outcome in the console. The issue is that the outcome from the PHP file is not getting printed out in the Ruby console app.</p>
  
  <p>This is my Ruby code:</p>
  
  <pre><code>require 'net/http'
  
  data = {'command' =&gt; 'Test'}
  postData = Net::HTTP.post_form(URI.parse('http://localhost/mysite/bin/app/handler.php'), data)
  puts postData.body
  </code></pre>
  
  <p>And this is my PHP file:</p>
  
  <pre><code>&lt;?php
  echo $_POST['command'] . ' test';
  ?&gt;
  </code></pre>
  
  <p>But this returns nothing. What am I not seeing and what is wrong with this code? I tried pointing to a bad URI and it returned me a <code>404</code> HTML page right in the console, but with my correct URI it's not working.</p>