/examples/google.rb
http://github.com/jnunemaker/httparty · Ruby · 16 lines · 10 code · 4 blank · 2 comment · 0 complexity · 586c4910e6a7a107bcfd1ac5ac8e997a MD5 · raw file
- dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
- require File.join(dir, 'httparty')
- require 'pp'
- class Google
- include HTTParty
- format :html
- end
- # google.com redirects to www.google.com so this is live test for redirection
- pp Google.get('http://google.com')
- puts '', '*' * 70, ''
- # check that ssl is requesting right
- pp Google.get('https://www.google.com')