[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Difficulty posting to form via http

soren.burkhart

5/15/2006 7:47:00 PM

I am having troubles posting data to a form.

It appears that all that is happening is that the form gets called, but
it does not pass the variables.

What am I doing wrong?

Soren

@http=Net::HTTP.new('www.secure.com', 443)
@http.use_ssl = true
@http.start() {|http|
req = Net::HTTP::Post.new('/login')
req.set_form_data({'ID'=>'userid', 'Password'=>'password'})
res = http.request(req)
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
print res.body
else
res.error!
end
}