title: RoR Net::HTTP post error undefined method `bytesize'
body: <p>I am currently banging my head against the wall repeatedly until I get passed this issue. I'm using ruby-1.9.3-p194 and Rails. I'm attempting to make a post request which I can do fine with Net::HTTP.post_form, but I can't use that here because I need to set a cookie in the header. http.post is erroring saying</p>
  
  <pre><code>"undefined method `bytesize' for #&lt;Hash:0xb1b6c04&gt;"
  </code></pre>
  
  <p>because I guess it's trying to perform some operation on the data being sent.</p>
  
  <p>Does anyone have some kind of fix or work around?</p>
  
  <p>Thanks</p>
  
  <pre><code>headers = {'Cookie' =&gt; 'mycookieinformationinhere'}
  uri = URI.parse("http://asite.com/where/I/want/to/go")
  http = Net::HTTP.new(uri.host, uri.port)
  response = http.post(uri.path, {'test' =&gt; 'test'}, headers)
  </code></pre>