On 2/14/06, Sathya Shankar <[EMAIL PROTECTED]> wrote:
> Chris Schmechel wrote:
> Use Net::HTTP class of Ruby to check the response by navigating to the page.
>
> require 'net/http'
> h = Net::HTTP.new('www.foo.com', 80)
> resp, data = h.get('/index.html', nil )
> puts "Code = #{resp.code}"
> if #(resp.code) == 200
> puts "The page has loaded"
> else
> puts "The page Error!!!"
> end
Nice. I'm starting to really like net/http. I use it a lot, and it's
really convenient.
-Chris
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general