olicitud @HTTPS utilizando el formulario de bloque Net :: HTTP: ¿es posible?
Para hacer una solicitud Net :: HTTP https sin el formulario de bloque, puede hacer esto:
...
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
...
Pero, ¿hay alguna manera de decirle a Net :: HTTP que use https al hacer el formulario de bloque?
u = URI.parse(url)
Net::HTTP.start(u.host, u.port) do |http|
# if I put http.use_ssl = true here, ruby complains that this can't
# be done becuase the sesion has already started
resp = http.get(u.request_uri)
end
Estoy en Ruby 1.8.7