Skip to content

Instantly share code, notes, and snippets.

@nhmood
Created January 27, 2014 21:45
Show Gist options
  • Save nhmood/a387d1b05107db9fcf75 to your computer and use it in GitHub Desktop.
Save nhmood/a387d1b05107db9fcf75 to your computer and use it in GitHub Desktop.
http_opts
#############
# Version 1
#############
# Default HTTP option hash
HTTP_opts = {
:url => String.new, # URL Endpoint
:ssl => false, # SSL Enable (HTTPS)
:method => String.new, # GET/POST/PATCH
:auth => Hash.new, # Authentication credentials (Basic or Token)
:headers => Hash.new, # Array of additional headers
:data => Hash.new, # Hash of data for POST
:verbose => false # Verbose output from Net::HTTP
}
#############
# Version 2
#############
# Default HTTP option hash
HTTP_opts = {
:url => "", # URL Endpoint
:ssl => false, # SSL Enable (HTTPS)
:method => "", # GET/POST/PATCH
:auth => {}, # Authentication credentials (Basic or Token)
:headers => {}, # Array of additional headers
:data => {}, # Hash of data for POST
:verbose => false # Verbose output from Net::HTTP
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment