Module: CloudstackClient::RequestHandling

Included in:
Connection
Defined in:
lib/cloudstack_client/request_handling.rb

Instance Method Summary collapse

Instance Method Details

#send_request(params, opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/cloudstack_client/request_handling.rb', line 3

def send_request(params, opts = {})
  params['response'] = 'json'
  params['apiKey'] = @api_key
  print_debug_output JSON.pretty_generate(params) if @debug

  data = params_to_data(params)
  uri = URI.parse "#{@api_url}?#{data}&signature=#{create_signature(data)}"
  http = build_http(uri)
  response = request_with_retries(http, uri)

  handle_response(response, opts)
end