# This is the piece of tool that will do the queries. # It needs values for input maybe could only be made into a function. # Where do we give it the arguments? # Will it be embed on the bridges or will # This will be a metamodule or an abstract class and it will accomodate to all cases require "http/client" module APIConnect extend self # params = URI::Params.encode({"author" => "John Doe", "offset" => "20"}) # => "author=John+Doe&offset=20" # HTTP::Client.get URI.new("https", "novoa.nagoya", query: params) do |response| # puts response.status_code # => 200 # puts response.body_io.gets # => "" # end def requestGet # The logic of this shit works but I am going to steal code from irs # The code from IRS does not enable an Authorization Workflow for spotify baseUrl = "https://api.spotify.com/v1/me/playlists" key = "BQBemjJEL0k8Wg2J6Mi7pg-vKCA1SFDy06JVv8oeXck98P4a660BpF7ScpVrCZzMEGmvBo0lunmfucakBTSUeNVAJaXrs56pdFQjicQN9ueW2GVGo68GZqk06FZJOOYZHqmhomwbZ28FOGiYfosN_1GysjYQKOHnu01efGTsuzFCE2yCC7s9tJNpow" params = "?key=#{key}" response = HTTP::Client.get(baseUrl, HTTP::Headers{"Authorization:" => key, "Accept:" => "application/json", "Content-Type:" => "application/json" }) puts response.to_s puts response.body puts response.status_code end def requestDelete end end