def execute_request(method, path, conditions = {})
      method = Client.map_method_to_http_verb method
      resource_descriptor = ResourceDescriptor.new path, method

      response = Http::Exceptions.wrap_and_check do
        params_key = [:post, :patch, :put].include?(method) ? :body : :query
        Client.throttle_request_rate
        Client.send method,
                    api_uri(resource_descriptor),
                    params_key    => Utils.stringify_keys(conditions.merge(default_params)),
                    :headers      => OandaAPI.configuration.headers.merge(headers),
                    :open_timeout => OandaAPI.configuration.open_timeout,
                    :read_timeout => OandaAPI.configuration.read_timeout,
                    :timeout      => OandaAPI.configuration.open_timeout
      end
      handle_response response, resource_descriptor
      rescue Http::Exceptions::HttpException => e
        raise OandaAPI::RequestError, e.message
    end
def execute_request(method, path, conditions = {})
      method = Client.map_method_to_http_verb method
      resource_descriptor = ResourceDescriptor.new path, method

      response = Http::Exceptions.wrap_and_check do
        params_key = [:post, :patch, :put].include?(method) ? :body : :query
        Client.throttle_request_rate
        Client.send method,
                    api_uri(resource_descriptor),
                    params_key    => Utils.stringify_keys(conditions.merge(default_params)),
                    :headers      => OandaAPI.configuration.headers.merge(headers),
                    :open_timeout => OandaAPI.configuration.open_timeout,
                    :read_timeout => OandaAPI.configuration.read_timeout,
                    :timeout      => OandaAPI.configuration.open_timeout
      end
      handle_response response, resource_descriptor
      rescue Http::Exceptions::HttpException => e
        raise OandaAPI::RequestError, e.message
    end
@private
 Executes an http request.

 @param [Symbol] method a request action. See {Client.map_method_to_http_verb}.

 @param [String] path the path of an Oanda resource request.

 @param [Hash] conditions optional parameters that are converted into
   either a query string or url form encoded parameters.

 @return [OandaAPI::ResourceBase] if the API request returns a singular
   resource. See {OandaAPI::Resource} for a list of resource types that
   can be returned.

 @return [OandaAPI::ResourceCollection] if the API request returns a
   collection of resources.

 @raise [OandaAPI::RequestError] if the API return code is not 2xx.