Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Last active March 9, 2020 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gr33n7007h/7c6810b8924ff741367de2bd1844a97f to your computer and use it in GitHub Desktop.
Save gr33n7007h/7c6810b8924ff741367de2bd1844a97f to your computer and use it in GitHub Desktop.
require 'net/http'
endpoint = URI("https://blah.biz/whatever")
Net::HTTP.start(endpoint.host, endpoint.port, use_ssl: endpoint.scheme = 'https') do |http|
request = Net::HTTP::Get.new(endpoint, {'Authorization' => "Bearer #@api_key"})
http.request(request) do |resp|
p resp.code
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment