From 6105ea621c77592ba22b6fc8bf3d9dc8696e634f Mon Sep 17 00:00:00 2001 From: Dan Milne Date: Wed, 10 Aug 2022 12:00:10 +1000 Subject: [PATCH] Debugging --- lib/paapi/client.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/paapi/client.rb b/lib/paapi/client.rb index e398026..a5e9434 100644 --- a/lib/paapi/client.rb +++ b/lib/paapi/client.rb @@ -1,5 +1,6 @@ require 'net/http' require 'aws-sigv4' +require 'byebug' module Paapi class Client @@ -24,7 +25,14 @@ module Paapi @condition = condition self.market = market @partner_tag = partner_tag if !partner_tag.nil? - @http = HTTP::Client.new + + if defined?(HTTPX) + @http = HTTPX.plugin(:persistent) + elsif defined?(HTTP) + @http = HTTP::Client.new + else + @http = nil + end end def market=(a_market) @@ -64,6 +72,7 @@ module Paapi private def request(op:, payload:) + byebug raise ArguemntError unless Paapi::OPERATIONS.keys.include?(op) operation = OPERATIONS[op]