Ruby v2 introduced Net:HTTP.get(uri)
which allowed for handling HTTPS URI objects seamlessly.
For example, you can call Net:HTTP.get(URI('https://google.com'))
without any special incantations.
However, the minute I supply any headers as a second argument. I get a type error.
require 'net/http'
Net::HTTP.get(URI('https://google.com'), { 'Accept': 'text/html' })
# => Caused by TypeError: no implicit conversion of URI::HTTPS into String
Is there any workaround that doesn't require using the older methods?