rails で HTTPSに接続する
こんな感じ
require 'net/http'
require 'net/https'
require 'uri'uri = URI.parse(url)
http = Net::HTTP::new(uri.host, uri.port)
if url.index('https') == 1
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
http.start{|w|
res = w.get(uri.path)
put res
}
【送料無料】 RAILSレシピブック183の技 / 高橋征義 【単行本】 |