5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/files.com/api.rb', line 5
def self.send_request(path, verb, params, options)
warn_on_options_in_params(params)
options[:client] ||= ApiClient.active_client
= options.clone
api_key = .delete(:api_key)
client = .delete(:client)
session_id = .delete(:session_id)
if session = .delete(:session)
session.save unless session.id
session_id = session.id
end
resp, options[:api_key], options[:session_id] = client.execute_request(
verb, path, api_key: api_key, headers: , params: params, session_id: session_id
)
options_to_persist = {}
options.each do |k, v|
options_to_persist[k] = v if Util::OPTS.include?(k)
end
[ resp, options_to_persist ]
end
|