Method: Bandwidth::BaseController#execute_request

Defined in:
lib/bandwidth/voice_lib/voice/controllers/base_controller.rb,
lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb,
lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb,
lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb,
lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb

#execute_request(request, binary: false) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bandwidth/voice_lib/voice/controllers/base_controller.rb', line 26

def execute_request(request, binary: false)
  @http_call_back&.on_before_request(request)

  APIHelper.clean_hash(request.headers)
  request.headers.merge!(@global_headers)

  response = if binary
               config.http_client.execute_as_binary(request)
             else
               config.http_client.execute_as_string(request)
             end
  @http_call_back&.on_after_response(response)

  response
end