Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Created January 26, 2014 19:12
Show Gist options
  • Save alaingoldman/8637695 to your computer and use it in GitHub Desktop.
Save alaingoldman/8637695 to your computer and use it in GitHub Desktop.
uri = URI.parse("https://coinbase.com/api/v1/buttons")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(uri.request_uri)
request.add_field('Content-Type', 'application/json')
button = { :name => 'test', :type => 'buy_now', :description => 'sample description', :include_email => true }
request.body = button.to_json
response["Authentication"] = "api_key"
#request["Authentication"] = "api_key"
response = http.request(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment