Created
June 19, 2014 23:05
-
-
Save charleyhine/0dd1a7504c00b121de74 to your computer and use it in GitHub Desktop.
Chain | Address Transactions (Ruby)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
# Request: My API (http://api.chain.com/v1/bitcoin/addresses/1CbC9CrmxoZAzHu16ccQsBGMNZbCZ3xAUc/transactions?limit=50) | |
uri = URI.parse("http://api.chain.com/v1/bitcoin/addresses/1CbC9CrmxoZAzHu16ccQsBGMNZbCZ3xAUc/transactions?limit=50") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.read_timeout = 30 | |
request = Net::HTTP::Get.new(uri.request_uri) | |
# Headers | |
request.basic_auth("GUEST-TOKEN", "") | |
# Send synchronously | |
response = http.request(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment