前回のnet/httpライブラリを使えば、簡単にHTTPS通信も可能です。
HTTPS通信の実行プログラム
require 'net/https'
uri = URI.parse("http://on-your-mark-i.blogspot.jp/index.html")
https = Net::HTTP.new(uri.host, uri.port)
# SSLを使用する
https.use_ssl = true
# 証明書を検証をしない
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
https.start {|hs|
  #送信
  response = hs.get('/')
}
 
 
 
 
 
 
0 件のコメント:
コメントを投稿