Skip to content

Instantly share code, notes, and snippets.

@Nucc
Created April 20, 2013 14:39
Show Gist options
  • Save Nucc/5426200 to your computer and use it in GitHub Desktop.
Save Nucc/5426200 to your computer and use it in GitHub Desktop.
Get the content of HTTPS site.
require 'net/https'
http = Net::HTTP.new("gdata.youtube.com", 443)
http.use_ssl = true
uri = URI("https://gdata.youtube.com/feeds/api/videos/56quf8OdX6Q")
params = { :v => "2" }
uri.query = URI.encode_www_form(params)
req = Net::HTTP::Get.new(uri.to_s)
res = http.request(req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment