title: Sending a Post request with net/http
body: <p>I need to send data in JSON to another app which runs on the same computer.<br>
  I send request like so (rails 3.2.13 )</p>
  
  <pre><code> data = { //some data hash }
   url = URI.parse('http://localhost:6379/api/plans')
    resp, data = Net::HTTP.post_form(url, data.to_JSON )
    p resp
    p data
    { resp: resp, data: data.to_JSON }
  </code></pre>
  
  <p>But i get <code>Net::HTTPBadResponse (wrong status line: "-ERR unknown command 'POST'"):</code>
  How can i solve this problem?  </p>
  
  <p><strong>Update 1</strong><br>
  Updated my code as @Raja-d suggested  </p>
  
  <pre><code>  url = URI.parse('http://localhost:6379/v1/sessions')
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    resp, data = Net::HTTP.post_form(url, data)
    p resp
    p data
  </code></pre>
  
  <p>But i still get error  <code>Net::HTTPBadResponse (wrong status line: "-ERR unknown command 'POST'"):
  </code></p>