Trouble with Net::HTTP.post_form

Hello,

I am trying to debug a problem where an action submits a form
unsuccessfully. The code I'm looking at looks just like the code on
Ruby-Doc for post_form:

url = "https://some.url.com"
res = Net::HTTP.post_form(
  URI.parse(url),
  {
    'formid' => formid,
    'Contact0FirstName' => first_name,
    'Contact0LastName' => last_name,
    'Contact0Phone1' => phone,
    'Contact0Email' => email,
    'type' => type
  }
)

However, post_form is throwing the exception: wrong status line:
"\025\003\001\000\002\002". Can anyone shed some light on what this
error message means? Thanks!

Matt White wrote:

I am trying to debug a problem where an action submits a form
unsuccessfully. The code I'm looking at looks just like the code on
Ruby-Doc for post_form:

url = "https://some.url.com"
res = Net::HTTP.post_form(
  URI.parse(url),
  {
    'formid' => formid,
    'Contact0FirstName' => first_name,
    'Contact0LastName' => last_name,
    'Contact0Phone1' => phone,
    'Contact0Email' => email,
    'type' => type
  }
)

However, post_form is throwing the exception: wrong status line:
"\025\003\001\000\002\002". Can anyone shed some light on what this
error message means? Thanks!

Perhaps you've required net/http instead of net/https.

Didn't make a difference. I tried posting with the Mechanize gem and
it works though, so whatever Mechanize is doing under the covers for a
post is better than what I was doing.