7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/mirakl/api_operations/request.rb', line 7
def request(method, url, params = {}, opts = {})
warn_on_opts_in_params(params)
opts = Util.normalize_opts(opts)
opts[:client] ||= MiraklClient.active_client
= opts.clone
api_key = .delete(:api_key)
api_base = .delete(:api_base)
client = .delete(:client)
resp, opts[:api_key] = client.execute_request(
method, url,
api_base: api_base, api_key: api_key,
headers: , params: params
)
opts_to_persist = {}
opts.each do |k, v|
opts_to_persist[k] = v if Util::OPTS_PERSISTABLE.include?(k)
end
[resp, opts_to_persist]
end
|