Ruby 使用 HTTPS

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'net/http'
require 'net/https'

url = URI.parse('https://example.com/')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true if url.scheme == 'https'

request = Net::HTTP::Get.new(url.path)
puts http.request(request).body