Sha256: a218d3d7f8e2db2818a80107f7ff6d84cead664bfe4ea52a3663dd3d85c6c899
Contents?: true
Size: 700 Bytes
Versions: 1
Compression:
Stored size: 700 Bytes
Contents
module G5Updatable class Fetcher extend ::G5AuthenticationClient::AuthTokenHelper def self.get_with_token(url) response = do_with_username_pw_access_token do |access_token| ::HTTParty.get(url, { query: { access_token: access_token }, headers: { 'Content-Type' => 'application/json', 'Accept' => 'application/json' } }) end case response.code.to_i when 200 JSON.parse(response.body) when 404 raise "Couldn't find record at URL '#{url}'" else raise "I got an unexpected response code '#{response.code}'" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
g5_updatable-0.20.3.pre.1 | lib/g5_updatable/fetcher.rb |