Wrong number of Arguments error in Net::HTTP.get call

151 views Asked by At

I am trying a simple get call in Rails 5.2 application as follows.

   uri = URI("https://www.google.co.in")

   req = Net::HTTP::get(uri)

It gives following error.

1: from (irb):85:in `rescue in irb_binding' ArgumentError (Failed to open TCP connection to www.google.co.in:443 (wrong number of arguments (given 4, expected 1..3)))

Note : Same code works in Rails 3 application. What am I doing wrong here?

0

There are 0 answers