title: Sending http post request in Ruby by Net::HTTP
body: <p>I'm sending a request with custom headers to a web service.</p>
  
  <pre><code>require 'uri'
  require 'net/http'
  
  uri = URI("https://api.site.com/api.dll")
  https = Net::HTTP.new(uri.host, uri.port)
  https.use_ssl = true
  headers = 
  {
      'HEADER1' =&gt; "VALUE1",
      'HEADER2' =&gt; "HEADER2"
  }
  
  response = https.post(uri.path, headers) 
  puts response
  </code></pre>
  
  <p>It's not working, I'm receiving an error of:</p>
  
  <pre><code>/usr/lib/ruby/1.9.1/net/http.rb:1932:in `send_request_with_body': undefined method `bytesize' for #&lt;Hash:0x00000001b93a10&gt; (NoMethodError)
  </code></pre>
  
  <p>How do I solve this?</p>
  
  <p>P.S. <code>Ruby 1.9.3</code></p>