I would like to check if the URI will need SSL authentication:
url = URI.parse("http://www.google.com")
# [some code]
if url.instance_of? URI::HTTPS
http.use_ssl=true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
However, those few lines throw the following error..
/usr/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): HTTPS (URI::InvalidURIError)
from /usr/lib/ruby/1.8/uri/common.rb:485:in `parse'
from /usr/lib/ruby/1.8/uri/common.rb:608:in `URI'
from links.rb:18
Why is it happening?