-
-
Save havenwood/eac4b183d33a2d489b5578ac685cbe9f to your computer and use it in GitHub Desktop.
craysiii
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 'net/http' | |
require 'uri' | |
uri = URI.parse 'https://api.twitch.tv/kraken' | |
request = Net::HTTP::Get.new uri | |
request['Accept'] = 'application/vnd.twitchtv.v5+json' | |
request['Client-Id'] = '<client_id>' | |
request['Authorization'] = 'OAuth <oauth_token>' | |
req_options = {use_ssl: uri.scheme == 'https'} | |
response = Net::HTTP.start uri.hostname, uri.port, req_options do |http| | |
http.request request | |
end | |
# response.code | |
# response.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment