Forum: Ruby Posting Forms

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E31769e963ffbd409d4267b100866872?d=identicon&s=25 Chris Long (Guest)
on 2005-12-20 02:53
(Received via mailing list)
Posting forms looks like it should be easy with Ruby 1.8.3 and
net/http.

Can anyone provide an example of submitting a search to e.g.
www.google.com,
and printing out the results?

This code doesn't seem to work.

require 'net/http'
require 'uri'

#site='http://www.google.com' doesn't work either

#site='http://www.google.com/search'
btnG='random'

res = Net::HTTP.post_form(URI.parse(site),
                          {'btnG'=>btnG})
puts res.body

-Chris
This topic is locked and can not be replied to.