Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Last active January 24, 2017 13:29
Show Gist options
  • Save alaingoldman/8635009 to your computer and use it in GitHub Desktop.
Save alaingoldman/8635009 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 = http.request(request)
ERROR CODE: 401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment