Open main menu

Wikibooks β

Ruby Programming/Standard Library/Net::HTTP

< Ruby Programming

How to access webpages with Net::HTTPEdit

Allows access to downloading webpages.

a 1.8 example:

require 'net/http'
mainp ='', 80)
response, content = mainp.get('index.html', nil)
puts content

Here is the rdoc which contains many examples.

See also OpenURI.

how to do it with https (ssl)