Secure HTTP with HTTPS : HTTPS « Network « Ruby

Secure HTTP with HTTPS

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

url = URI.parse('')

http =, url.port)
http.use_ssl = true if url.scheme == 'https'

request =
puts http.request(request).body


Related examples in the same category

1.Get a secure way of sending sensitive information to the remote server:
2.Making an HTTPS Web Request
3.Set verify mode for https
4.verify_mode = OpenSSL::SSL::VERIFY_PEER