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

No members online now.

Forum statistics

Threads
473,821
Messages
2,569,749
Members
45,733
Latest member
MariaQch13

Latest Threads

Top