module PriceHubble
module Client
module Utils
module Request
extend ActiveSupport::Concern
CONTENT_TYPE = {
json: 'application/json',
multipart: 'multipart/form-data',
url_encoded: 'application/x-www-form-urlencoded'
}.freeze
included do
def use_authentication(req)
req.params.merge!(access_token: PriceHubble.identity.access_token)
end
def use_default_context(req, action)
req.options.context ||= {}
req.options.context.merge!(client: self.class,
action: action,
request_id: SecureRandom.hex(3))
end
end
end
end
end
end