Net/http question

Hello Ruby users,

i got the following question for you:

The following function:

def ret
  return [0, 1]
end

returns an array with two elements.
If i use this function like this:

ar = ret

the variable ar contains the array.
If i use the get method from the
net/http module like this:

h = Net::HTTP.get("/index.html", nil)

the h variable just contains the Request
object and not like documented the array.
Which is given back when using irb. I can
see it there.
Is it possible to store the array given back
by the net/http get method?

···

---
  Fabian Boucsein

Hi,

  In mail "net/http question"

···

Fabian Boucsein <kanvas75@web.de> wrote:

If i use the get method from the
net/http module like this:

h = Net::HTTP.get("/index.html", nil)

the h variable just contains the Request
object and not like documented the array.

Net::HTTP#get returns a Net::HTTP::Response object from Ruby 1.8.
If you want Ruby 1.6 compatible behavior, use:

  require 'net/http'
  Net::HTTP.version_1_1

Best Regards,
Minero Aoki