Difficulty posting to form via http

S

soren.burkhart

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
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,708
Messages
2,569,347
Members
44,654
Latest member
7Jhamal74

Latest Threads

Top