Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@huezoaa
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huezoaa/4104d1a70217bd051301 to your computer and use it in GitHub Desktop.
Save huezoaa/4104d1a70217bd051301 to your computer and use it in GitHub Desktop.
Ruby Curl
require 'httparty'
# puts ARGV
# p ARGV
#### Hint: When you pass arguments to Ruby through the Command Line,
#### they get set into a Constant Array variable named ARGV.
case ARGV[0]
when "GET"
url = "http://" + ARGV[1]
# puts url
response = HTTParty.get("#{url}")
puts response.headers
puts response.body
end
# puts ARGV[0]
# puts ARGV[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment