Ruby 使用 HTTPS

2015-09-11 0 611
Ruby 使用 HTTPS
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

遇见资源网 ruby Ruby 使用 HTTPS http://www.ox520.com/16476.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务