Ssl encryption with post_form()

im writing a program that needs to post a form, and iv found that i can
do this with post_form(), but i need to send it over a connection with
ssl encryption. heres my code

require 'net/http'
require 'uri'
res = Net::HTTP.post_form(URI.parse('http://the/url'),
{
'my test' => 'variables'
}
)
puts res.body

and that works, but without ssl. i wanted somthing like this

require 'net/http'
require 'uri'
res = Net::HTTP.post_form(URI.parse('http://the/url'),
{
'my test' => 'variables'
}
)
res.ssl = true
puts res.body

but i havnt found anything. hope i have been clear

···

--
Posted via http://www.ruby-forum.com/.

im writing a program that needs to post a form, and iv found that i can
do this with post_form(), but i need to send it over a connection with
ssl encryption. heres my code

<snip>

but i havnt found anything. hope i have been clear

Did you try googling for "ruby https post"? The first few results will
have some answers.

Regards,
Ammar

···

On Fri, Nov 5, 2010 at 8:19 AM, Robbie Mckennie <robmckennie@msn.com> wrote:

Ammar Ali wrote in post #959518:

···

On Fri, Nov 5, 2010 at 8:19 AM, Robbie Mckennie <robmckennie@msn.com> > wrote:

im writing a program that needs to post a form, and iv found that i can
do this with post_form(), but i need to send it over a connection with
ssl encryption. heres my code

<snip>

but i havnt found anything. hope i have been clear

Did you try googling for "ruby https post"? The first few results will
have some answers.

Regards,
Ammar

<sarcasm>
hee, thanks, i didnt think to google it
</sarcasm>

i already tried that, didnt help

--
Posted via http://www.ruby-forum.com/.

.facetiousness
  %strong Maybe your google is broken?!

Without quotes, I get this as the first result:

  http://snippets.dzone.com/posts/show/788

With quotes, I get this as the first result:

  http://javazquez.com/juan/2008/12/07/ruby-https-posting/

Note how both include things like:

  require 'net/https'

and

  http = Net::HTTP.new('host.tld', 443)
  http.use_ssl = true

Regards,
Ammar

···

On Fri, Nov 5, 2010 at 10:58 PM, Robbie Mckennie <robmckennie@msn.com> wrote:

<sarcasm>
hee, thanks, i didnt think to google it
</sarcasm>

i already tried that, didnt help